Optical pulse sensor not producing a clean TTL pulse
The schematic is incorrect.  For the circuit to produce a positive-going pulse when the optical sensor is illuminated, transistor Q3 must be a PNP (or p-channel) type.  With that change, it looks like it should work as described.
The noise bursts occur at 10 ms intervals, indicating a 50 Hz power system.  They could be coming from anything plugged into the line that has an electronic control - dimmable lights, clothes dryer, induction cooktop, etc.  They might be visible on the output of a properly working unit if the scope scale is expanded enough.
The most likely suspect is the board assembly - solder joints, solder bridges, etc.  Next up is a failed part.  Probe the base of Q1 on the good and bad units and compare.  It should be a sorta kinda square wave moving between 0 V and 0.6 V.