I know whenever someone says anything negative like this people come out of the woodwork to say the opposite, and that's fine, but I can't name a single competent programmer who doesn't say things like this in private, and I know a lot of them.
Test it for yourself. The next time you need one of the mediocre people on your team to do something pay attention to how they do it. I will bet you it's something like this: Get the ticket. Spend a day or two trying anything they can think of, googling, pasting stuff into chatgpt, etc. Then they start messaging people. They tend to try to not always ask the same helper because it would get too annoying, so they rotate around the team asking for help. The helper starts by offering suggestions, but the mediocre dev can't get those suggestions working or apply them correctly. Pretty soon the helper just types a bunch of code into the chat window so they can go back to what they are trying to do. The m dev takes this code, and pastes it into their branch. It's not quite right though, it needs a little tweaking to work but they can't figure out what to do, so they message the next helper. (And sometimes it's hilarious what it is, a lot of times it's a typo and when you run the code it says exactly what line it's on, but they don't know how to run code besides pressing the button in their editor that someone else set up for them) To helper 2 it seems like they are making good progress, they are just stuck on some small thing. Happens to everyone. They tell them exactly what's wrong. And voila, this is how about 30% of the people you work with write code. People don't catch on because when you are helper #2 you assume they wrote that perfectly competent code.