This is a downside, not a benefit. I don't want to hear about your compilation error when I'm heads down on my own work.
With few exceptions, juniors are in the default mindset that they're bothering people when they have problems. My job is to socialize them out of that. I accomplish that by bringing them into the office, because the alternatives very rarely work.
Now, I’ll submit there are people who are not considerate at all. And to be honest, a lot of people have become way worse since the pandemic. It’s almost like they’ve forgotten basic human decency. And those people can be far more disruptive in person than they can be remote. But there are ways to resolve those issues (basically by telling them that you’re busy and not indulging them when they’re disturbing you, and very quickly they’ll get the hint).
Personal productivity does not necessarily map organizational productivity. You might be insanely productive by focusing heads down on your work all the time, but the organization as a whole may not grow as much.
Now, this may not apply to you and your organization at all, or may not even be generally true, but I did want to point it out because a lot of people here wonder why managers would ask them to come to office even though they believe they’re clearly more productive at home. There are non nefarious reasons leadership may be asking for this.
I never said I don't answer people asking for help. I said working remotely allows me to decide WHEN I answer people asking for help.
If someone cannot wait 30 minutes for me to finish whatever the hell I'm doing, and try to solve or at least understand their problem on their own in the meantime, they should be fired.