My favourite timing bug
About 15 years ago, a screenscraper returning empty handed except when debugging was on. Then it was fine. Lowering the debug verbosity made it fail again.
Dev had accidentally coded the timeout to wait for the Mainframe to 0 milleseconds. One line of java logging, at sufficient verbosity, between the request and the attempt to read the response took a couple of msec to execute - and by then the MF had responded.