I think it would be easier to explain the Mary Sue accusations by comparing badass female protagonists who had to save the day to each other to note the differences between Mary Sues and strong female characters.
Let`s compare Rey with Mulan. A badass female chinese woman.
That woman saved China BTW, and she defeated the big bad who was the leader of the Huns, a completely badass and cunning strategist.
Why was Mulan was received?, well, is not because of "beautiful disney princess". (of course, some people may find asian women incredibly gorgeous, but is important to notice that during the time of that movie, character design was aimed to appeal western audiences)
There are 2 key differences:
1-She had to earn her victory. She struggled along the way.
She was the blacksheep of her ancestors. She didnt fit the standards of chinese women.
She disguised herself as a man to take her father`s place as a warrior to defend China and to protect her father.
She didn`t fit well in the army at first, and reality ensues when she is not an instant expert. She had to train and became a badass through sheer determination, discipline and a cunning mind.
2-She has clear personality traits. She is not a blank slate.
She uses her smarts and creativity to solve daily problems and avoid chores when she was at her home. (she was initially a bit lazy, but she had to overcome this flaw in the military.)
She is loyal to the end, even when she was abandoned when the army discovers she was a woman (she had to disguise herself as a man to be able to join the army)
She prioritizes doing what is right over following the rules. But this rule break had consequences.
She fails to fit all the feminine standards, one may claim she is a bit tomboyish, but that doesnt completely makes her "one of the guys". She will wear an armor in war, but in calm times she usually wear simple dresses.