"Unemployed" implies having no or very little money. Having enough so that you don't have to work would definitely improve mental well-being for the vast majority of people I think
The original comment being responded to used the words "having to go to work". It was a reply that introduced the term unemployment and drew conclusions based on it.
It's plausible that being in poor mental health might make someone more likely to be unemployed, but that employment can still worsen someone's mental health. Even if unemployment is net better for someone's mental health than working we might see a trend where on average mental health is worse for unemployment due to the fact that employment (of a lack of it) might not cause as of an effect as other factors.
So you think unemployed people are in better mental health than those with jobs?
I guess this is part of the reason why we need these studies: because people's default assumptions are often wildly off.