External interfaces matter much more than internal implementation details.
The worst developer I ever worked with, from a team productivity perspective, was a developer who had normal interpersonal skills, had an extremely high opinion of himself, had a disdain for development work relative to management, and had repeatedly failed at management. He was emotionally invested in the idea that he was a different and better kind of person than the other developers, but the people he identified with (managers) did not accept him as a peer, and he hated himself for it.
The development work he was supposed to do made him feel bad about himself, so he did the minimum (though the work he did was solid, though old-fashioned) and invested his energy into anything where he got to judge and direct other developers: diagnosing problems of the team, dictating processes and tools for developers to use, making project plans. He made his manager feel like he was their eyes and ears in the development team. He was utterly focused on his relationship with his manager, to the point where he didn't realize that he needed to be concerned with his relationships with anybody else. He was always outwardly friendly, and people started out liking him, but after a month or so, people learned to read condescension into everything he said. Since he had earned the complete trust of the manager, the situation couldn't be repaired, and the team basically disintegrated. Nobody could put their heart into their work under those circumstances, even if they tried.
He was always cordial and always had a graceful thing to say in any situation, the opposite of the toxic geek stereotype, but he had a worse impact on team dynamics than any of the egomaniac programmers I've worked with, including the ones who were overtly abusive towards other programmers.
Which brings me to another topic. Why do people always focus on the individual jerk, who may just be reacting to group pressure? Most atrocities and lies in human history have been perpetrated by ideologically or tribal groups. It is the group leaders who are dangerous, not a sigma male who is ignored anyway.
(The answer to the question is of course that the group leaders control the narrative and communication infrastructure.)
Edit: Also note that confidence and performance could be 100% correlated even if everyone rated themselves as higher than average. Correlation doesn't mean accuracy, it means that we can calculate their performance based on their confidence.
Does this not show a J-shaped relationship between ability and confidence? [1] shows a weak negative correlation (highest between multiple studies was -0.36). I wouldn't call that a high correlation.
[1] https://www.sciencedirect.com/science/article/abs/pii/S01674...
They ask people to self-evaluate and then call the people who evaluate themselves better than others as "top performers" and the people who evaluate themselves as not better than others as "poor performers". But self-evaluation is really bad to show how someone will perform, especially if you focus on a group who has difficulties (or bad past experience) with team work and socialization (because they are obviously biased when they compare themselves to the team).
In fact, I would be surprised if a big part of "poor performers" are not really good performers with imposter syndromes (which is more common amongst good performers) and a big part of "top performers" are not opinionated idiots who cannot accept that sometimes they get things wrong and therefore blame the team for their "good idea" (which is in fact a stupid idea) for not being taken on board.