Rey's choice marked the Skywalker family's ultimate victory over Palpatine, definitively ending their decades-long conflict. Others thought the scene played as heavy-handed fan service that closed the saga out on a whimper, rather than a triumphant note.
One of the more common criticisms lobbied against the sequel trilogy is that the narrative wasn't planned out in advance. While there are benefits to giving directors creative freedom on their films, Lucasfilm's approach arguably led to a series of movies that were seemingly at odds with each other (see: the number of perceived Last Jedi retcons in The Rise of Skywalker). The studio's habit of using tie-in publications like official novelizations to clear up muddled plot points like Emperor Palpatine's return is also seen as proof of a lack of a plan. However, one of The Rise of Skywalker's most notable twists was established well before the Star Wars renaissance kicked off.
The book The Art of Star Wars: The Rise of Skywalker details a Lucasfilm story group meeting taking place in May 2014, roughly a year and a half prior to The Force Awakens' premiere. Pablo Hidalgo had this to say about Rey's role in the saga and how she could still be a Skywalker even though she wasn't born into that family:
"I like the idea that she's going to be our Skywalker, but she's not a Skywalker. Then, for our purposes, 'the Skywalker' is really a metaphor. It doesn't have to be something that's directly connected to blood."
From this, it sounds like the sequel trilogy was always going to build up to the Rey Skywalker scene. Lucasfilm was apparently thinking ahead and establishing a foundation for the new films early in their development. It's unknown if the plan was for Rey to be Emperor Palpatine's granddaughter at this stage (The Last Jedi's core theme that a hero can come from anywhere.
This revelation may not be enough to make up for the general lack of cohesion across the sequel trilogy, but it's still a cool detail illustrating Lucasfilm's creative process. It's true the franchise was crafted in the mold of making things up as they went along (look at all of the Star Wars retcons George Lucas implemented in the original trilogy), but in modern franchise filmmaking, it helps to have some semblance of a plan to stick to. Surely, there were a number of twists and turns along the way, but the final scene in The Rise of Skywalker was a culmination of a meeting that happened more than five years before it premiered. That had to be very satisfying for the story group to see their vision come into fruition.
Source: The Art of Star Wars: The Rise of Skywalker