I would say bad engineers tend to know they are bad and either tend to go into managing, coordination roles or grab a subset of tasks they get good at, like being the only one on the company working with eg. a specific third party system and doing support and integration for that.
Bad engineers that have worked with the same system for three years are way better with it than super-engineers that have never touched it for at-least a couple of months.
As you said, I have never really had problems with bad engineers messing things up.
EDIT: Reluctance to hire engineers and saving pennies for a dollar on the other hand have messed up some projects.
It's when that bad engineer starts protecting "their" turf at the expense of the rest of the org in order to provide themselves with job security that things start to really go south.
There's no way to guarantee a successful engineering hire, but organizations try to because their culture is so blameful or fearful of conflict that all the incentives are misaligned.
I believe most organizations copy the Google, Facebook, etc. hiring processes with the goal of adopting an "industry standard process" because they don't know how to conduct an interview process that's tailored to their own organization, and they don't want to think too deeply about it.
Having a coherent interview process means dealing with your organizational baggage: understanding it and either resolving it or crafting the interview process to select for people who can integrate well with it. Usually it's the latter, since most of the issues start at the top.
Google, Facebook, etc. have spent a lot of time and money crafting a good interview process for their organizations: specifically what they value and don't value (even if the individual interviewers aren't always fully aware of what the organization is selecting for). They can also support a lot of false negatives.
But the copycats don't have those same needs or candidate pool, so it always comes across as a bit disconnected to me.
or you can just waste all the time firefighting with consequences of bad software.
it's not the only factor, but it can matter. the majority of companies i worked suffer from this. what really mitigates the problem is that competitors have the same problem on average.
In my 12+ years career, I've worked with so-so engineers, but never truly bad ones that would ruin a project. And even the ones that weren't great, what damages did they really cause? I've seen many more companies failing because of a bad product, bad sales strategies, bad market fit, bad business model than engineering teams using the wrong programming language, or not building microservices the right way.
I find this constant obsession around identifying "rockstars", avoiding "bad" engineers at all cost to be truly unhealthy.