In elementary school, I was in the "Gifted" program. It meant 1 day per week I would go to the library with a teacher that taught special stuff like "logic problems" and doing research and making slideshows. It was a
lot of stuff.
This is where I learned to program. This single skill was hugely impactful to me.
But the rest of the time was probably actually more helpful, as I was forced to do all the rest of my classwork for my regular classes and pass all my regular tests in addition to all the work for Gifted. This kept me much, much more engaged in education than I would have been otherwise.
Middle school had 1 class per day the same way, but it was a pale shadow of the Elementary version.
High school had "Honors" or "AP" (Advanced Placement, IIRC) classes that totally separated me from the kids that were just there to put in time. They had no interest in learning and were actively against it, but I was no longer associating with them for Literature, Science, and Math classes, and there were no class clowns to slow everything down. We also had dual-enrollment classes where college classes were taught at the high school for credit in both.
Missing out on these 3 systems would absolutely have stunted my growth and I doubt I'd be where I am today without them.
My wish isn't to separate kids, though. I wish they could all enjoy learning like I do. We haven't cracked that nut yet, though, and it seems like separation is still necessary in order to give everyone their potential.