I was writing a screen blanker for the Commodore 64. It was meant to work like the simple one on the TI-99/4A: countdown timer (I actually used a CIA TOD alarm) then set a bit to blank the screen, then reset that bit once a key is pressed. Simple!
Except it would not work. I removed the TOD alarm and implemented a countdown using an unused zero-page word. I rewrote the TOD alarm handler. I checked and checked. Hours staring at this simple code, not understanding why it would not work. I even duplicated functionality in BASIC (with an ML helper for the TOD alarm) to verify that I was POKEing the right places.
The next day it hit me. Square in the gonads. I had a BNE when I should have used a BEQ. STUPID STUPID STUPID! I was using the WarpEngine's ML monitor to write my code, and I probably could have found it if I had stepped through the code line-by-line (which, now I think of it, I believe the WarpEngine can do.)
Ah, well. Lesson learned.
Another really good one would be when I was attempting a hardware upgrade for a client running an Exchange 2003 server. I had diligently moved the Exchange database files to the D: partition so I could nuke the Windows installation in case the hardware move did not go so well. Everything worked perfectly except that I had missed moving the log files, and they got nuked. It took this poor machine 30 hours to do an eseutil repair on 42GB of email for a multi-million dollar company, and made me sweat every minute of it. That has been the only major failure this server has suffered in the past eight years -- by my own hand!