Perhaps you can strike up friends at a co-working space or a company where RTO is optional. (I go snowboarding with a former co-worker occasionally. Since we live far away it's usually a big trip, yet still no less an adventure.)
Hopefully losing your job won't also put your social life at risk.
That’s not to say it’s impossible, of course, but just much harder. Your professional social network is much smaller remotely. You have to work with someone remotely for months to form the same relationship you could have in an afternoon in-person.
Hybrid work is a good compromise.
Losing my job wouldn’t put my social life at risk - as work relationships don’t and shouldn’t fill that role for me. Again, you seem to be conflating personal and professional relationships.
I might pick up a hobby and make some friends there - these friends are going to linked to my personal life, not my professional one.
I cannot ask this hobby friend for a referral for a job in the future. I cannot ask this hobby friend for some help if I’m dealing with a difficult boss or a challenging technical problem.
I might ask this friend to come skiing with me or come to the bar with me though. That’s nice, but it’s not a work relationship and I can’t fulfill work relationship needs through it.