Law of the miracle-working colleague
The bug that has been tormenting you for hours vanishes the instant you call a colleague over to look at it, and reappears as soon as they go back to their desk.
Every office has a colleague with powers. They can't program any better than you, they didn't study any longer. Simply, when they approach your monitor, the bugs stand to attention and pretend not to exist.
'Show me,' they say. You repeat exactly the same steps, in the shaky voice of someone reporting a ghost. The program works. They pat you on the shoulder with the air of a family doctor. They leave. The bug reappears, and smiles at you.
Programmers even have a name for these shy errors: bugs that change behaviour when you observe them. I solved it at the root. I printed a life-size photo of the colleague and hung it behind my chair. It works sixty per cent of the time.