It is sad to hear of the isolation of gifted kids. It seems to be the rule, not the exception.
I was fortunate, my elementary was a magnet that did all kinds of experimental learning. I had to bus all the way across town (small town) to go there, but for my parents it was worth it.
Some experiments were elementary went to 6th grade, we learned french, and 2nd and 3rd grade were combined for awhile montessori style. However, even at the magnet, in 5th grade three of us were far enough ahead that they gave us an algebra book (9th grade) and had us self teach. But at least there were 3 of us, and Im still friends with them 40 years later.
For high school I went to a university affiliated magnet high school which ran 5 years starting at 7th and was created to serve the children of professors at the university. I didnt want to attend but my parents essentially coerced me.
I was reasonably challenged the whole time and it was a safe place to be a nerd. The school let you start taking community college and university classes when you were ready. The classes werent designated as AP classes, but they still prepared students for the AP. My sophomore high school chemistry textbook ended up being my university chemistry textbook.
I would say the school worked. Around half the class of 40 are professors. My kids are not really gifted so I wont push them in that direction, but where I live now has a very good set of magnet middle/high schools.
I agree that the pacing is slow in public schools. Kids probably only get 2-3 hours of actual learning each day. Our kids go to a spanish immersion private school that also teaches chinese. They typically are a year ahead of public school. For example my first grader started multiplication and fractions by the end of the year. However with us all being home due to covid we have moved him even faster than the accelerated curriculum and are pretty much done with the second grade curriculum this summer. I would not even classify him as gifted so more kids can probably go faster than the typical public school curriculum.
Ultimately in bigger cities the options exist via private schools, charter schools, and magnet schools but a lot depends on the parents' motivation and knowledge. I think for all the bad rap public schools get, they do a decent job of teaching the bulk of kids.