I've actually got a funny story: I divided by zero to fix a bug.
I was working on my program, when one of the Goto commands couldn't find the label. There was a label of the same letter there, but it just couldn't find it. I did all I could, and the bug remained. Instead of giving up, I placed some error-inducing code (1/0) after the Goto to see if it would respond. I ran the code, and somehow, it worked!