I've had bugs go away when I added `print("working fine until here")` to the preceding line. So if someone told me "this line is needed but I don't know why", I wouldn't even blink.
I've had a few of those, I think they're usually a symptom of stack corruption.
Timing matters.