The flame sensor is part of the spark electrode assemble
Not only does the gap have to be correct (1/8") but the electrode also has to be directly in flame path (engulfed by flame)
Gas valve and spark electrode get DC voltage at same time.......gas valve only gets voltage for 6-8 seconds during ignition then IF main flame does not light off and PROVE it circuit board drops DC voltage to gas valve closing it.
The millivolt signal generated by main flame is what circuit board needs to keep gas valve open. If electrode is not engulfed by main flame or is dirty the signal can not go back to board