Are you blocking lookahead before the M96? If not, the M96 is probably being processed at lookahead time, so the output may not be in the same state when it is polled as it is when the line is reached in the program. The example in the manual shows using G103 P1 right before the M96 (and then use G103 after to cancel lookahead blocking). That's the only thing I can think of off the top of my head.