First and foremost, employees who don't work when at home office, are usually not that productive in the office either... (unless the reason for unproductivity is induced externally, such as kids - but those people usually WANT to come to the office anyway). If there's an attitude issue they are not loyal employees and need to be fired either way. The problem is not remote working, it's simply that the wrong people have been hired. Period.
Secondly, everyone claiming that those lazy guys should now come back to office and start working are either bad employers or questionable empoyees. As an employer, if you can't trust your employee to get the job done it's your and only your fault to hire that person. Meanwhile an employee who was in home office claiming people should get back to office to actually work should have an appointment with HR. Clearly they either judge others from their own attitude or they know employees who mistook home office for vacation and didn't communicate it. Either way, there's an issue that needs to be discussed...
Generally, people believing that in the digital age people need to sit in a regular office (no special equipment, no customer contact,... only regular PC work) 5 days a week 8 hours a day didn't make it into the 21st century.
Especially, in the software industry there are a lot of introverted people who are probably a lot more productive working from home at the time which suits them best -which may very easily NOT be 9 to 5.
That is essentially different from many other industries and need to be taken into consideration. Especially since the "performance" (or lack thereof) can be rather easily measured on the various collaboration plattforms especially when it comes to coding. I don't see how having those kind of people work in a crowded office increase the productivity.
That said, ~2 office days/week can help a lot with coordination, however, beyond that IMHO the overhead on time spent commuting and so on takes over. E.g. just halve an our spent commuting per day (= 15min one way, which is extremely optimistic) adds up to 2,5 hours per week.
If that's done by car that extends to less traffic, less pollution,...
Instead those 1,5-2 hours gained can be used in a meaningful way.
Last but not least, allowing people to work remote doesn't mean they have to. So, for people who believe that working in office is better than from home, just do so... but don't force your own personal preference on others, it may not be the case for everyone.
That comes from someone who prefers a 50:50 mix...