I think it's sexism that made them make Rey so flawless. Male characters with flaws are called 'Antihero', female characters with flaws are called 'Bitch'. If they had made Rey as bratty as Luke was at the beginning they would have been accused of making her a stereotype, and the writers knew this.
That makes as much sense as saying racism put Barack Obama in the White House.
Rey was simply written as a strong character, a survivor, a scavenger, a loner, but not for the sake of feminism. If Rey had been a man, no one would blink and think, hey, that's a strong male lead! It's the viewer's interpretation that can be construed as sexist.


