That has a lot more to do with personality than career. If you’re an irritating know-it-all weirdo, people aren’t going to like you regardless of your job. I’ve known engineers like that that, but most people I know and work with are normal people and are respected.
That victim blaming just plain doesn't line up with reality. Outright assholes are downright lionized. Perfectly upright people are looked down upon for "weird" fields or ones which make them feel insecure or inadequate.
Sounds like lawyers and doctors (or plenty of people really).
> weirdo
That is a bit of a stereotype. I suspect a large percentage of software jobs are filled by standard people. The weirdos do stand out, but I don’t know anyone who actually fits the Hollywood stereotype.
And weirdo be replaced by equally socially unacceptable traits (arrogant or closed-minded etcetera) that apply to doctors and lawyers.