There's something a bit strange about the whole "return to the office" narrative from some companies and media outlets.
If you watch YouTube videos from tech companies, perhaps a majority are made with people working remotely; companies seem to be doing perfectly well with people all over the world making technical presentations for their channels, from home offices.
In the media, an example would be GB News that talks quite a bit about "people should return to the office", but around half of their commentators are calling in from home.
I think people may have a point that in some cases "return to office" mandates are a way to get people to leave, without having to pay redundancy. It's also possibly related to powerful real-estate companies influencing the discourse, as the values of their investments dropped. I've posted before about the strange situation when I was based in Amsterdam years ago, when there were many huge office buildings empty for years, but the rental prices were kept the same...
For the record, I DO work from an office, not from home, but it is my own office that I set up to be especially productive - a 10-minute commute time, peace and quiet, good lighting, top end equipment, gigabit internet - and I get to choose the coffee :)
I just wasn't as productive in the usual open-plan offices that are very common now; too many distractions, everyone ended up wearing noise-cancelling headsets to be able to think. One problem I had seen a lot was sharing space between different disciplines - software devs that needed focus mixed in with service reps that needed to be constantly communicating with customers.
Also, bad lighting is too common; I used to have to wear glasses due to eyestrain, but with my own environment, I now don't.