I can attest that it's bad for your mental health. Most of my episodes correlate to a job. I had one where I got so bad, they hauled my ass into HR to bring up a whole host of things I had done wrong. They sent me home for the day to "think about how I wanted to respond." It was such a magnanimous offer considering that one of the things I was being harangued for was making the project 1 day late due to my wife's emergency surgery. I came back the next day and told them I just didn't give a shit. I couldn't bring myself to lift a finger or to even stay to the end of the day any more. A few weeks later, they walked my ass out. My depression lifted as I drove home.
Funny follow-up to the story. There was a guy there who took over supporting my code after I left. He threatened to leave and they made him a counteroffer with a 50% raise. A year and a half later, that guy couldn't even get out of bed any more he was so depressed. He had a newborn and spent 6 months in bed too depressed to move.