(there is $120B+ in remote enterprise market cap as of this comment, anyone saying it doesn't work is a liar; it might not work for them because they are unwilling to make it work, but the evidence is clear it can work, does work, and did work during the pandemic)
I've personally worked at 4 different companies since early 2020. Not everyone does WFH well. Many pretend they do, but don't. Even those that do it well, do better when they meet regularly in person (have some hybrid model). Some teams/departments/functions are better at it than others, but companies as a whole I think perform better when the people have personal connections and relationships across the org. In a remote WFH situation, over time, through natural attrition, new people are onboarded and never actually meet anyone in the company and this becomes a large portion of employees that are very loosely connected in terms of their interpersonal relationships/network and this weakens the organization. I can see how that is fine in a individual contributor role of SWE, but for most roles, in most departments, it doesn't play out well (or takes a very special/rare personality trait to actually do it well).
IME, remote work works best when everybody in the company buys into it and there's an effort to make it run smoothly. Conversations in chat, always online meetings, etc.
Considering most companies were forced into remote work by a pandemic with no planning or anything, it's surprising it's gone as well as it has, but it's also not surprising it's gone badly for a lot of companies.