Varies by individual
WFH has less distractions / interruptions so you can be far more productive & control your day better e.g. I start well before my official start time so can then have a few breaks in the day (as 100% focused coding all day is draining), so do the allotted hours (& usually a bit more) but with healthy breaks (and also far fresher without stressful commute), but some people like the social environment of an office.
If I get mandated to do x days a week in the office I will be looking for a new role (and if no remote ones available, retiring early*), and on the days I am in the office my productivity will fall massively due to all the chat interruptions.
* Mainly working to build up savings for retirement, could retire now but extra savings good to allow for more freedom to do stuff when retired (as cost of living shooting up) - and to cover unexpected situations when retired e.g. with how UK NHS has been destroyed by conservative government then sadly private medical services may be only option for quality of life operations with massive NHS waiting lists (e.g. artificial joints)