The loss of programmer productivity can easily be overshadowed by gains from other parts of the business. I know it's not always the case, and nobody wants to hear that their suffering is better for the company as a whole since it devalues your work, but I would be super curious to hear why the decision was made.
Productivity is not progress, for sure. You can be very productive building the wrong thing. I've been there, wasting a year on some crap that was canned. But you need to be able to deliver and not actively frustrate your devs that want to get shit done. Otherwise the 'adapted to the market' is just a scam at best.
btw, not every dev is the same. Some actually do like being in the office, even putting on music and have lots of small talk. That's also fine, if it works for them. And I also see benefit of going to the office myself (once a week or so).
I'm pointing out the pattern of sales & management incompetently projecting their own needs and biases onto the whole company and treating devs as grunt workers, forcing them to comply with their rules and fulfill their needs regardless of how it impacts their ability to concentrate and deliver. Software development is not grunt work.
I see fulltime RTO orders as a reflection of this. Smarter management will understand what devs actually need and take that seriously. Usually this kind of management has a technical background. Office can be a part of that, sure, but wfh invariably is too, I'm convinced.
I've worked for dozens and dozens of managers in my career. Some will go out of their way to buy you the best laptop, even make you coffee and give up the best seat in the office just so that you can work in peace. Because they know that such investments in their staff will pay off. Then, others will loudly interrupt you, deny any small request out of petty resentment, and blame any and all problems on your laziness - that is if they actually show up to notice there is a problem.
I've worked in places where sales people were seated next to programmers, and the sales people were shouting through their phones continuously. The programmers complained endlessly about all the noise - without effect. First lockdown we had showed an increase of at least 300% productivity - hard and reliable numbers because all output was tracked voluntarily by the team (management never asked for this). Number of builds, commits, releases...everything was way up. It was quite shocking.
As soon as lockdowns were lifted managers began talking about being in the office fulltime, because it was so good to talk to each other and align your work. I remember working in a team that did 1 day a week at the office, that day we couldn't get anything done because everybody was just chit chatting all the time. Even if you wanted to - it was just impossible to focus.
Our security officer (CISO) remarked how the lockdown enabled him to think seriously about a security issue for the first time in almost two years. Isn't that tragic?
Companies are as rational as consumer behavior. You can't make this stuff up. Never attribute to malice that which is adequately explained by stupidity.