Much better to just connect with people that share your same interests outside of work. Join a club, go to a meetup, etc... And quite frankly, when it comes to more technical matters, I find online conversation to be much more fulfilling than IRL. And there are no shortage of outlets for that, including HN.
I consider myself very lucky to live in the Bay Area, where most of my kids' friend's parents also work in tech. So hanging out at a random birthday party ends up being an unintentional networking event, where I get to meet new people working on cool tech.
I wonder as remote work continues to be popular, if that will continue.
In NYC, I'd say there is a lot more diversity in terms of industries people work in, but tech is noticeably a tiny minority. Finance is obviously huge - and is probably the industry closest to being in the situation you describe.
Case in point - I am, and have been part of, various social organizations, and AFAIK I'm the only SWE I've encountered. Tons of finance people, tons of medical professionals (though interestingly enough, many many dentists and nurses but M.D.s are rare), tons of people in marketing and education. But no SWEs. A tiny handful of tech professionals from the helpdesk/sysadmin/networkadmin side of things.
We don't all want to be your friend, we want to avoid the rat race.
Even my kids’ friends’ parents are often tedious to hang out with. “Can you believe <insert thing from popular TV>?” Or some town gossip that is interesting only to the other half of the conversation.
I have non-work friends, most of which I met locally, but there’s a common interest beyond “you happen to get your mail delivered by the same person”.
Work socializing has some advantages for introverts. You don’t generally have a lack of topics to discuss; if one gets boring, you can switch to another.