That's actually not that rare when I work later than usual. Some stupid problem my brain is too fried to solve. Eventually I give up, feeling defeat for the whole evening and solve the problem in 10 mins the next morning. Get enough sleep, people.
However, much research shows the hand banging against the wall period is required for you to achieve the morning breakthrough.
The sleeping break is where your neurons form new connections based their activity yesterday. The “thinking hard” and the frustration is a required part of the morning epiphany.