The best solution by far is allowing for flexibility. Some people prefer WFH, some don't. And that's ok. You're getting the highest employee satisfaction by providing both as options, while allowing people to decide where their performance is the highest at the time, and frankly where they feel the most comfortable. Some people can't wait to leave home and they actually recharge at the office. Some are the exact opposite.
We've got hardcore nerds (and normal people) who are thriving beyond words knowing they will never have to go back. They're getting much more done and you can tell they are much happier than I've ever seen them at work. And we've got those who got back as soon as they could - they literally commute to the office to dial in from there and are glad to do so for a variety of different reasons, usually ranging from uncomfortable/distracting home office space to loneliness and need to fulfill social needs.
One random observation that I didn't expect at our work is that people with more authority/higher positions are the ones who are more likely to want "office life", despite seeing productivity dramatically rise and costs fall since the move to "work from wherever you want". At this point I'm fairly sure they just want to enjoy their "higher" status in real life. They don't get greeted by crowds of wage-slaves all visibly respecting their authority when everyone's home. At this point whenever I hear of big company execs broadcasting the desire to move back to the office I just feel like they're driven by vanity, because 'power' just doesn't feel as gratifying over Zoom calls. WFH has been a great equalizer in general - people communicate more as peers, and nobody knows where you live, what you're wearing, or what car you drive. Things like who's given the bigger and better office (which is in a way creating a toxic power hierarchy) become non-existent. We've got assistants with big, beautiful houses and great home offices, and directors working from their apartment kitchens. Contacts are listed alphabetically, and everyone is equally reachable. Those who previously benefited from special treatment are therefore complaining the most.