At home nothing prevents me from not working and I often don't. The difference is, at home you can spend your time with a book, cooking, with kids or spouse - which all is refreshing and in general will improve your performance once you get back to work.
In the office not working constitutes mostly of playing dumb games or reading hacker news, the latter being kind of ok, but certainly it doesn't leave me refreshed and willing to go back to my not-so-hip-after-the-latest-js-framework code.
I don't think it's realistically possible to put a metric on one's performance, that would allow us to break from time-based evaluations completely. That being said, I see how my colleagues are progressing with their work and it has nothing to do with which are working from home, which from office and there is also no clear time-value correlation either. It has more to do with how motivated they are, what internally drives them and how skilled they are.
I have a friend at work who believes deeply in software craftsmanship principles and it's a privilege to see how he works. He stays at home more than most of us, but provides a steady and consistent stream of small, high-quality pull requests, all day, every day. I watch how not slacking at work can have a great impact on the project and on the team morale. It has very little to do with an open space, WFH, what kind of laptop you work on and what blend of coffee you are given. I grew to believe those are just excuses I (and others) are giving themselves to not fully focus on work. Once I admitted that to myself, I decided to spend my slacking time in a way that improves my performance later. I hope one day it will go away completely, or I will get organized enough to be consistent in my output regardless of interruptions.