Tying your identity to the place where you're helpful and where that help is appreciated and acknowledged isn't mental illness.
Do you think it is healthy behavior to go to a parking lot at 0900 every day and do nothing because you mentally cannot face the idea of not going to an office?
That's just your take. We don't know where he sat in the team, so we can assume the idea that he wasn't appreciated by his teammates as incorrect. He didn't make the cut based on unknown metrics from upper management, but they have their own reasons for doing things.
Getting in to the parking lot of the old office sounds way healthier than not making it out of bed at all.
Missing your ex and lying around depressed in bed is less unhealthy than getting into the car and sitting outside their house.
At minimum I think it would be healthier to tie part of your identify to an aspect of your career you enjoy rather than a specific employer itself.
Instead he chose to sit alone in a parking lot so he could feel "normal". Feeling compelled to do a specific action (excluding things like breathing) just to feel normal has a name, and that name is "addiction". It is not usually considered a good thing.