If coming from a low-income situation and being adopted into a complicated yet opulent life of wealth and intrigue makes your character a Mary Sue, then that makes Harry Potter a Mary Sue.
A character’s life events don’t make them Mary Sues/Gary Stues; they only fulfill that archetype if they are devoid of imperfections, complexities, and flaws.
I talk about this archetype a little more in my post on depicting female characters. You may also find my respective posts on female characters to avoid in your writing and getting to know your characters applicable.
I hope this helps, and happy writing! ❤
I mean, that’s basically half of Batman’s kids right there, and they’re not Mary Sues because they’re three-dimensional characters…