I went to the local comp, which was average but really good for extra-curricular. I managed AAAB (ore-A* days) and have degrees from 2 elite universities and a successful carer. So that supports your thesis.
However... I do have moments where I go cold realising how very close I came to disaster: I was in the school's top sets for every subject but one. In those top sets the students were fairly well motivated and the teachers good. In maths I started in the top set, but a new pupil came who was better than me, and I was dropped into the second of five sets. In that 2nd set, the pupils just didn't want to be there, the teacher was appallingly bad, could not control the class, and as no one could hear him, he set exercises from the textbook each lesson and then sat with his head in his hands. At first I tried to work, but I needed help and he was either dealing with other pupils who were shouting, singing, throwing chairs, or sitting and not engaging at all. It was incredibly difficult to get any work done because of the noise and distractions. Try doing maths in the middle of a children's birthday at the soft play, and you'd understand.
My grades got worse and worse, I became less and less motivated. I learned nothing in four years with this teacher. Luckily my parents were able to get me a little private tutoring, and thanks to that I (just) scraped a C. If I hadn't got that C, I wouldn't have been allowed to continue to A-level, let alone study A-level science and apply to the top universities in the country. No way would I have got into my career.
I reckon if you're very capable in a subject, you'll probably still do pretty well in a not-so-good comp, but if there's any subject where you are weak, the cracks will show, and you'd better hope it's not something like maths or English.
DD is similar to me, bright and in top sets, but not as confident in maths. She tends to bob around at the bottom of the top set and top of the second set, at her junior school. She needs that extra bit of time and guidance in maths, and for that reason we think she will do better at a private school.