This is not true. My brother just retired as the CEO of a multi-national medical support company. When covid hit, they shut down a 10 story office building in the Houston area, and various other offices around the world and had everyone working online from home.
Since then, they determined that office personnel working from home are measurably less productive. But, the cost savings in not having to support the brick and mortar office structure made up for the loss in productivity. However, the real loser in all of it was the customer. They now have to wait longer for service as a result of the loss in productivity.
If you measure productivity it is kinda easy to find the slackers who are working at home.
You warn them to get it together.
If they do not they get fired.
Easy peasy.
Bad managers are the only ones who cannot figure out how to make work at home equal or improve productivity.