If I know there's a kid down the street who seems like he will grow up to be a criminal, and another kid who seems like he'll grow up to be a kind, hard-working, well adjusted person, there is a 100% guarantee I will encourage my kids to play with the second kid, not the first.
If the school is bad enough, then an average student there (because there are many more students than teachers) might not be a good influence.
There are schools in my state with <50% graduation rate, the average student there won't even finish the school.
All I know that children (and many adults too) do similar thing that their peers do. So if I want to increase the chance that my child will graduate from high school, they should be around people who will graduate from high school. Similarly, if no one in their class will go to college, the chances they will go to college will be smaller.
Note there are exception to the each rule, and I am talking about "chances", not certainties.
I know families that homeschool and I like to read articles like this one to see if anyone "gets it." So far, no hits.
They're opting out of mediocre instruction and government-mandated values enforcement ("DEI" in its public school curricula form); the other kids are irrelevant. The homeschoolers I know are average and have lots of social activities with average peers in their community.