Reproduce the screenshot and you not see the rail being unpowered but the observer emit a pulse
(while the state of the rail does not change andit is supposed to detect state changes !).
I have tested it with a repeat command block ( /testforblock <coords> golden_rail powered=false ) and it find nothing whilst the observer does.
It goes off and on in the same game tick, the observer sees that, and the command block isn't fast enough.