This is a good point; it's very important to provide advanced students with a challenging environment. I'd argue that just as important, however, is the access to other advanced students that comes along with it.

TL;DR for the below brain dump: when your peer group values low achievement as its own form of achievement, it takes a lot of lucky breaks and facepalm worthy epiphanies to right the ship.

PS: having now written the below, I realize the entire thing sort of hinges on whether I am actually smart and a reader has no reason to assume that is the case. I'm leery of looking like a narcissistic humblebragger but at the same time need to justify including myself in the group "smart people." My "I'm pretty smart" creds: pre-personal dark age, I won my middle school geography bee and did decently at the state-level competition; post-personal dark age I scored a 1600 on the GRE. I'm loathe to mention either and never do IRL because they were both kinda gimmes I was born into vs achievements earned via hard work but I think here they provide useful context.

The anecdote proper:

Growing up, I was in gifted classes through 7th grade. Life got hard in the way it does for kids that age though and, with my grades slipping, I was moved into normal classes.

As a smart kid taking standard difficulty classes, one is very much exposed to the anti-intellectualism that is so popular in America currently. If getting picked on for being a dweeb in the half of the day i wasn't in the advanced classes wasn't optimal, moving out of them completely was markedly less so. Some people adapt and overcome. Personally, I internalized the bullying and negative feedback, adopted an "if you can't beat 'em, join 'em" philosophy and proceeded to waste years trying to impress the wrong people with how normal and cool I could be. I graduated in the bottom quartile of my class, one F shy of spending a fifth year in high school.

On the strength of an oddly incongruent SAT score and a letter of recommendation that I would give my right hand to read, I still managed a very good scholarship to an out of state public school. Even with this opportunity dropped into my lap, I had to be talked/coerced(!) into taking the scholarship. I just did. not. get. it. AT ALL.

I went to college because my parents were going to start charging me rent and I more or less thought I'd party for a while and then drop out and "join the Marines or something." My first semester I found a new group of bros just like the ones from high school and earned a 1.7 GPA.

Something else happened that semester though. When I did manage to make it to my lectures, I really enjoyed them. I'd skip tests and not do classwork but I'd read and listen to lectures diligently. There was one specific class called "Primates, People and Prehistory" that particularly blew my mind. If curiosity is a pilot light, that course was the spark that reignited it.

I came back that Spring ready to work, just missed a 4.0 (damn you, B+ in Português!) and managed to bring my grades up above a 3.0 to keep my scholarship. I spent several more years gradually learning to be okay with the fact that I enjoyed learning. I still hid it behind an "aww shucks, I'm just here to party" veneer but every semester I drifted further from my friends, had more excuses to bail on them and read until we were entirely different people. I still care about them and keep in touch, but I'm definitely the "weird one" now.

Were it not for a ridiculous letter of recommendation, or that long shot scholarship, or the awakening to the broader world of learning that first semester, my life would be entirely different. I had a huge "working hard and caring is for suckers" chip on my shoulder in high school and I think wherever I'd ended up, I'd still be sneering at the try hards and glorying in how I could have done just the same if I'd wanted to. It's taken years to recover from that detour and get my head right about who I am.

I'd like to think that if I'd stayed on the track most of my middle school peers were on, if I'd stayed surrounded by people who gave a damn, my detour into doubt and self-loathing might have been curtailed. As a 29 year old, I feel like it has only been in the past 2-3 years that I've shifted out of neutral and really earnestly started engaging with the world.

I'm wholeheartedly in favor of anything we as a society can do to save other "dumb smart kids" similar heartburn.