As someone who has worked remote long before the pandemic, this is a myth in my experience. I have had at least as many friendships formed with remote coworkers as I have in person office workers.
Occasional get-togethers do help with this quite a lot, but it's not necessary.
What I find strange about this reasoning is: doesn't every hacker have friends from around the world they've never met in person? From various software projects, open source contributions, online community connections etc I have a fairly long list of people who are very important to me that I've never met in person.