I'm sure many of us have worked with that type of person who is very good at what they do, but also a massive asshole, and then people put up with it, because, well, that's just part of being a genius (as an aside: this sentiment is often applied to other disciplines too; see, Max Verstappen in F1 or Magnus Carlson in chess.)
I learned long ago that no matter how good they are, it's not worth it.
Agreed. And one thing people seem to miss in this argument is that people can change, and generally will if they're in an environment that facilitates it. If a skilled programmer gets constant pushback because they act like a jerk, they'll probably figure out how to behave.