That is not an absolute. Being a developer is not just about writing heaps of code.
Maybe the developer who volunteers at a local community centre is better at dealing with people. Sure, they might not code as much, but they might be better at teasing requirements out of BAs.
Or it could be as simple as the developer who does their work during the day, goes home, cooks a meal, plays with their kids/socialises with their friends comes in the next day rested and ready to focus on their work, instead of trying to thinking about that problem in their personal project.
Or it could be that the guy who codes 24/7 is a total rockstar. But maybe working on that pet ML project in Tensorflow at home isn't really helping you write that REST endpoint in ASP.net at work.
There's no guarentee either way.