Mary/Gary Stu get thrown around a lot but generally it's not just being poorly written, it's being poorly written in a way that the character can solve all challenges presented to them with basically no effort akin to if they were a fanfiction wish fulfillment insert character. Rey fits this. If you have to explain your character getting force powers with "they watched another character do it so now they can" (The equivalent of Aaron Carter being as good at basketball as Shaq because he watched him do a dunk once) then you're in full Mary/Gary Stu territory. Every single obstacle Rey encounters is easily dispatched by her. In A New Hope Luke required Obi Wan to save him, R2D2 to save him, and Han to save him. Rey on the other hand just is instantly good at everything she touches and then beats the bad guy.
I've never encountered the "Mary Sue" trope in my professional studies of the narrative art form, not even as a trope that should be avoided (unlike the "Exposition in a Cafe" trope), mostly because it's proper original meaning is too close to simply being an "Audience Surrogate" common in most stories. The only
real difference between poorly written audience surrogate and and the "Mary Sue" trope is the aspect of Authorial Insert. But that aspect of the authorial insert is hardly recognized in the definition of the "Mary Sue" anymore (I doubt Lawrence Kasden is vicariously living through Rey), and the other ways in which the "Mary Sue" is defined apart from the authorial insert isn't unique enough in its own right to be considered an entirely new trope. This is probably why TV Tropes itself, a worthlessly entertaining waste of time on the internet, can't even define the term properly without it having 13 different applications, very few of which have an underlying commonality between them.
At the end of the day, the "Mary Sue" has too many applications to be useful in any conversation about characters in professional narrative art forms made for a generalized audience. It's really only useful in its original context as referring to perfect authorial inserts in fan fictions, in which case the "Mary Sue" is the entire reason why the work exists to begin with, since in many cases both the author and the audience for Mary Sues in fanfics is the exact same person. (AKA: The person writing the fanfic.) This makes the Mary Sue more of an exhibitionist work when the fanfic is published publicly for others to read. ("Fifty Shades of Grey" becomes a tad more interesting when considering this.) This is really the only way the term "Mary Sue" becomes useful in a discussion of narrative art forms. Outside of this context it's too unspecific and therefore useless to be used in a thoughtful discussion of the narrative art form.
Now I do agree that Rey is poorly written, or at least that her character contributes to the poorly written ending. (After all, the writing around Kylo Ren is just as guilty for contributing to the poor writing, as he's just so anti-climactic at the end of the movie compared to his strong and imposing introduction at the beginning of the movie.) But I find the "Mary Sue" term to be utterly useless any labeling any tangible reason as to why the writing doesn't work in this film.