FYI: I just remembered that a similar query came up in the past on this forum, and a couple of us wrote some code using various models to track pass/reject status with bits instead of integers and FFL/FFU. The results are in a repo on Github cf. here, which also references the original thread; clicking on the PDFs should be the easiest way to access what was done.
Anyone who reads the entire thread will see that parky's time-based solution was actually put to the test on a working prototype with a Meccano set from the 1950s!
My solution used a counter to keep track of the number of items* between the upstream sensor and the downstream reject station, and a BSR to pop the low bit from the array to trigger the reject station. It feels more complicated than it needs to be, which is also another reason to go with FFL/FFU i.e. hide all the bit tracking code under the hood.
* the number of items is also 1 more than the bit position of the next bit to latch on detection of a reject by the camera.