I think you are fixating too much on arbitrary rankings that don’t matter. I would think that a difference in ranking and test scores are irrelevant if the schools are functionally the same but have different environments. However this is just my opinion.
It’s uncommon to transfer within school districts but not rare. I think plenty of people transfer for mental health reasons, finance etc. Colleges won’t look at it negatively because the rankings of high school doesn’t matter unless you bomb your academics for some reason.