I had a project I was working on a while back. I kept testing it and trying to find the bug that was causing my output to be completely wrong. It took me about 2 days to finally find it:
I had a boolean set to false, when it should have been set to true.
That one little bug completely broke my sorting algorithm. After changing it, it worked fine. :/