I think it depends on the job role, the person, the stage of career.
It suits some personalities - and those with the space at home or in a nearby cafe or similar to be able to work with sufficient seclusion from others if discussing confidential info (some of the things I've overheard on commuter trains!) and sufficient networks bandwidth.
It simply doesn't work for all roles. I can WFH but only with planning - there are a lot of tasks I can only do in the office, and indeed, not all areas of the office, for security reasons, do I need to make sure any of those are postponable or covered by others if I WFH.
I think if you have a new person in a team, it can be helpful for relationship building and knowledge sharing to be physically together to start with. Having said that, I've successfully built relationships with overseas colleagues I've never met in person over the years, and sharing screens can get over a lot of the "let me show you how to do this" issues.
Several years back, I wrote my car off, and was stuck WFH for 3 weeks until I bought a replacement. It was not good for my mental health, but at the time I was living rurally and the lack of car meant I also wasn't getting to my evening classes or swimming pool in the next time, so living alone, I felt extremely isolated, as i was not able to see anyone much at all. During covid, in contrast, everyone was in the same boat, and making an effort to check in with each other, so I didn't feel alone in the same way.