Actually, this was one of the best losses because I played far better than expected, but you mentioned mentally checking out.
In the last 5.0 tournament I played (I'd been bumped down to a 4.5 a few years earlier) I was playing one of the favorites to win the tournament. I was playing really well - using my power to keep him on the run and chipping low and coming into the net. I was completely focused, which is rare for me, and determined to keep concentrating. I won the first set 6-3 and at the end of the second set finally got the break in the last game to win 6-4. I let out a cheer and a sigh of relief and went up to the net to shake his hand and he looks at me and says, "What are you doing, the match isn't over?" I recounted the games, and yes, it was only 5-4.
After that, I just couldn't get focused again. I played a few good points, but just got never back the level of intensity I needed to win. Lost that set and the next at 6-2.
Moral of the story, keep track of the score.