Yeah, I agree, but not knowing what you don't know applies to almost everyone in every skill, not just programming. I acknowledge I have gaps in my knowledge. But it's because of those gaps that I am always trying to supplement my knowledge by studying different data structures, different patterns for solving problems, different algorithms. I don't aim for complete mastery. I aim for basically "what can I add to my bag of problem solving tools." I concede that because the barrier to entry is low, stories similar to your anecdotes are probably quite common in most self-taught programmers. I think this just speaks to the necessity of rigor during the interview process. Like, does the candidate just know how to build features, or do they know how to design fail-proof systems?
Also, to clarify, I'm not arguing that self-taught vs CS grad is mutually exclusive to smart/not smart. There are plenty of not-smart self-taught engineers and plenty of smart grads.
> In limited domains
I'd argue that many, if not most, teams operate in limited domains.