I come from a place where specialists are hard to come by and when I finally got in to see someone about my condition she accused me of seeking pain killers (I was not, opioids are not going to help what is wrong with me) and then told me the symptom I was experiencing was my body "getting better". I went probably 4 years longer undiagnosed because of her. She eventually left the area and went to a teaching hospital to TEACH. When I told her what condition I believed I had, she literally laughed at my and ridiculed me for thinking I could self-diagnose. Meanwhile, I was diagnosed with this well after the damage was done and I experienced neck and lumbar fusion. Let's just there is a wide range of compentency in doctors, even specialists.
Doctors are no better or worse than car mechanics. Some are meticulous and think about the end result, others follow Mitchell’s or whatever and feel threatened whenever customers try to tell them what they think is wrong.
1) mechanic-like workmen in the classic mold of the "blue collar" work ethic but don't pretend to be better/worse than others. Often produce better results that the "IQ" tests would suggest.
2) Usually competent but imposter syndrome people that sometimes lose focus due to lack of faith in training and ability. Capable of high achievement (probably better than #1) but often struggle with consistency in end results. Often undersell themselves, so it's hard to tell if they know what they are doing.
3) Status seekers that hide subpar ability or even downright incompetence with degrees and arrogance. Kind of a high functioning "Dunning-Kruger" subtype with conman/sociopathic /social abilities.
4) The frighteningly competent that case #3 pretend to be, #2 might be able to do, and are basically #1 combined with real talent.
Sounds like you ended up with #3.
Whenever I encounter an "expert" in a field, it comes down to diagnosing whether they are a 3 or a 4.
I considered my experience with doctors and with programmers and middle managers (plus there was the Apple abuse story mulling through my head) and came up with that.
I'm a programmer and I'm an average #2.
#3s in programming are kind of different. Incompetents get weeded out quickly from true programming jobs and punted up to management likely where they become part of the Middle Management Machiavelli perpetual war.
#3s express themselves as moderate technical competence, a typical one would be someone that gets to declare greenfield to the specific stuff they have enough ability to do, gain sheen of competence, and then aggressively assume the role of "expert" based, since to management they "produced".
Next thing you know, some guy that could rapidly stand up a PHP site is in technical leadership and pushing for PHP to serve as a big data platform because it is (rolls another dice to determine buzzword) "agile".
Then they have as much or more organizational pull as a legit #4 and your organization is in TROUBLE.