Too often the word Mary Sue’s used to refer to either characters they hate (though I’m guilty of this to some extent) or complain about being too competent that I think Mary Sue actually and historically referred to idealised fan inserts interacting with official characters.
I did have a Mary Sue where I identified a lot with a certain character and based my character upon her, interacting with other characters but that happened mostly in my head as far as I recall. So a Mary Sue should be a character that fans live vicariously through, when it comes to stories they like.
When it comes to Kitty Pryde, she might be a better example of a Mary Sue as she’s dangerously close to the Mary Sue as identified by earlier writers: an idealised fan surrogate interacting with existing characters. She might be less Mary Sue if they played up her ruthlessness, given she’s shown to be one at times.
But that would mean certain characters would be made redundant and we’d see Kitty become a ruthless assassin (as shown in Age of Apocalypse) who attacks people with the focused totality of her phasing powers, so Psylocke wouldn’t occupy that role (at least until recently).
Play up the feline aspects, then she’s the X-Men version of Catwoman and a proper female counterpart to Wolverine so there’s no need for X23, that would involve thinking through characters and taking them to where they’d logically or realistically become.
That would mean actually following through the character’s logical progression and sticking to it, whether if they want to go through it or not like say turning Kitty into Professor Xavier’s brutal hitwoman (her beating up people in anger and assassinating people should be the logical or organic progression).
So Mary Sues aren’t necessarily flawless, but rather idealised fan surrogates that fans live vicariously through especially in fanfiction.