You are sort of right but I would argue you the solution backwards. As you note, while there are exceptions, generally good schools are made by good students, who are made by good parents. And you need a critical mass of students coming from decent and good backgrounds for a school to function. But once you have lost a school, outside of the rarest of circumstances, you are not going to get good students to come back. If everybody that has the means to abandons a school (which happens for a lot of delta and Jackson schools), you can't get good students to come back, because even if you still have say 30% of the student population come from supportive homes that are just too poor to escape, you're not going to convince the equivalent of say another 30% of the school population to come back at once because they will worry that the school will still not be good.
So while it would be a solution if we got all the students with good backgrounds back into public schools, it's extremely hard if not impossible to accomplish. And in some places, even if you got all the students from good backgrounds into a school, it still wouldn't be enough to make the school functional.
A much more modest goal would just be making sure that no children were denied the opportunity to receive an adequate education in a safe environment just because their parents are poor. They might get left out because their parents are poor and don't care as much as other parents, but not just because they are poor and in a poor area. That's a tough sell politically because that usually means something like school choice, which more or less requires acknowledging that some students don't have access to an adequate education in a safe environment and you don't have a way to fix it. Many people if not a majority of people would rather fewer students escape bad situations than admit that they don't have a solution.