I can't count how many times I stayed late at the office working on a problem for 6 hours straight, and then after a good night's sleep found and fixed the issue after 20 minutes at work the next day. Sleep is king.
I have latent dyslexia which seems to emerge after too many hours at a computer screen. I've come back from a good nights rest to find variable names that are just slightly misspelled, recursive loops that are unreachable, and functions that are incomplete because I was distracted by a bug hunt.
I think we all do this to some degree. When I'm working on a difficult problem, it feels like Christmas Eve, because I know I'll wake up and have the solution coded up before my coffee is gone.