Assuming it's possible for a given function/role/company's product, which is
quite common in world of software development, I find the whole trend of moving people back into the office at least a little perplexing and, frankly, short-sighted much of the time.
In 2001, I began switching my schedule to full-time remote[0]. I was working for a bankrupt telecom doing about three times the work a person could reasonably be asked to do (while what was being asked for was equally unreasonable given my salary). I had a great boss who -- while recognizing he couldn't do much about my salary -- was willing to do everything else and being at a bankrupt company, there was little in the way of "Corporate Handbook" policy that could get in the way any longer[1].
Over 17 years, about half or more of the company began working from home regularly, many full-time. This happened shortly after we deployed OCS 2008 R2 (what is now "MS Teams") which we did partly because "Cisco license renewal is expensive" and partly because most teams had members in more than one state -- in IT, we had members is several countries. We had these wonderful meeting rooms in every office, and people would take every meeting from their cubicles because "there's only 2 people from my 10-person team here, anyway".
If we had a role that could be done from anywhere, we'd routinely hire from a far-flung office. Literally no staff was available to research "what we should pay for this person if they live in Nowhere, Wisconsin." We don't even trust what what we pay current staff in the area because we just assume we underpay all existing staff. And the ones that set those rates often live in expensive places. So we'd make an offer at 30% above the going rate, get these amazing hires that -- maybe they really want to do the work, but they really want to do it if they can drive in to the office in the new car they can now afford. Meanwhile, they're among the lowest paid for the role, so HR thinks we got a deal!
Having "distributed teams", necessarily, adds friction to collaboration. Learning to address/be proactive with that friction is something that can bring it back to "the right level of collaboration." I love this assumption that "well, for certain highly collaborative roles", being face-to-face is necessary. Later you'll find that one of these roles involves software developers ... probably deploying to servers they don't have physical access to. I am deeply skeptical of this. What I suspect is happening is that there are a small number of people on the team who are highly-collaborative, a lot who benefit from it, but for whom "a little less talk and a little more heads-down writing code" would be helpful. I've been on highly-collaborative projects, totally remotely -- I literally sat on camera all day/into the evening a few nights in a row on one occasion (with five other people) -- it was equivalent to "coding in a conference room re-labeled 'WAR ROOM'" and taking sleep-breaks under your desk in the early 00s -- except I could cover the camera/nap in my own bed.
The list of "difficulties with remote teams" is filled with "reasons" that all have countless examples of "companies that are remote but aren't struggling with that problem." It sounds like a lot of it comes down to combinations of "organizational inertia" -- unwillingness to find/utilize tools which help reduce the friction of being fully remote[4]. Invest in researching the myriad of pros/cons -- the quality-of-life on the employee side means attracting a lot of talent that is missing their COVID-temporary remote status. Being able to hire outside of the difficult urban marketplaces, alone, should be enough of a savings -- even if you stayed "in-state" -- to make it worth the costs of providing high-end laptops/improving VPN gateways/subscribing to a few SaaS tools/cost of more frequent team-building and intentional team "remote shoot-the-sh_t" meetings.
Prior to COVID, I worked at a place that was a "no offices/no phones on desks" kind of "in-person" (ironically listing "remote friendly" on their job posting). There were a small number of remote employees, but they were due to extreme circumstances (and the fact that the owners were, honestly, great people), and they were relatively impossible to collaborate with if you were in the office, so they were "on project X or Y" always. We had offices in Seattle, Germany, NY, and India and most of us never talked to any of them. Their projects were almost all geographically near their office. We wrote software! (and, a lot of it, more than once for more than one person, without realizing it).
Somehow fates collided and we'd deployed Teams a month before COVID shut-down -- replacing Slack. Two weeks into COVID, all of us remote, and a few things happened. Work, basically, continued about as fervently as it did before. Development started having "informal" weekly meetings and we discovered all of the developers at other offices! Over two months, most projects consisted of teams across time zones (shock of all shocks -- "need" matches up more evenly with "developer availability" when the latter is widely spread out -- we had 4 people knowledgeable in Voice in Seattle doing one small project while we had 4 waiting for "the one voice guy" at our office).
It would be impossible for that company to justify to me, today, why I'd have to return to the office. By the time I left, we were doing more business, completing more work, and filling long-open positions more easily. As far as I know, they left the extremely expensive, but incredible office (that attracted me to accept returning to a daily commute in 2016). The company went from "minimally remote" to the point of not even integrating between offices well to "fully remote because the government said so" ... we had an "all employee" call, HR made some rapid adjustments and a lot of good choices and business improved. As an employee, we all just went to IM/Teams and adjusted ... it just meant having more time due to the loss of the commute.
Sure, it won't work for every kind of work to be done, but companies who's product is software that is deployed on hardware they no longer maintain -- the vast majority of roles, if not all of them, can be done remotely as effectively as in-person. We all watched it happen in real-time for a year -- some struggled ... we sure didn't -- among my friends, I can't think of one developer/IT/other who's company has requested them back into the office (either flex or full time). Among them, "getting new-hires up to speed" is the biggest stress point, but "it's been a couple of years, now" ... most have figured that out[5].
[0] By 2005, I still had a cubicle, but I came in, at most once a month.
[1] By the time I left, I hadn't seen my desk in over a year. At the time, working remotely at my company "officially" required written approval from a C-Level executive, keeping a daily work journal sent to HR and a number of other "we really don't trust you/want you to do this but there will be that one reason some day..."
[2] It didn't rank nearly as high with attracting customers -- it was the thing you didn't know you needed until you had it and we didn't know how to market it, apparently.
[3] I can't remember the history, but I know the application was designed there -- I think we acquired the company that developed it, originally, and integrated it into everything, but the original reason for hiring in WI was "that's where the team was". Over years, much of that staff was working on projects that had no presence in WI.
[4] Actually, it sounds more like companies are interested in tools that allow them to spy on remote workers. My attitude is "these are problems shared by every distributed team, whether those people are in an office or not" so if you wouldn't install that on a desktop in the office, it doesn't go on my work laptop in my home.
[5] Usually the "brute force" method is used: get a few people to the same place/derelict office for a two-week boot camp "here's the code, here's how things work, here's the obnoxious process, the time tracking tool, the 5 things we do once a year and can't remember how (and how to get to the page where they're all documented), and what's expected in what meetings" Fully remote doesn't mean you forbid face-to-face; I'd argue it's always optional -- I've done these things fully remote and seen it done well.