And I think the most brilliant thing about the ST is bringing Palpatine back. People think this was a last minute change, but I think JJ had this in mind from the beginning. It was pointed out before TLJ came out that musically Rey’s Theme was a variation on Palpatine’s theme.
I strongly recommend watching this video by a channel that analyzes musical scores:
He goes in depth into the details of Rey’s theme, and calling it just a variation of Palpatine’s theme is misleading. When analyzed, Rey’s theme contains traces of the Force theme, the Imperial march, and Palpatine’s theme, and can be harmonized with Yoda’s theme as well as others. The conclusion he reaches in the video is that Rey’s theme was deliberately designed by Williams to be as vague and versatile as possible, because he knew that the writers hadn’t decided on an origin for Rey yet.
Also, Daisy Ridley said in an interview that Rey being a Palpatine was not at all part of the original plan. She actually said there was talk of making Rey a Kenobi.
And keep in mind, the EU already did the whole thing of bringing back Palpatine. And arguably, the EU did it better because it actually accounted for how the heroes were going to prevent Palpatine from returning again in the future. And even then, it was an extremely divisive move at the time. And if the ST writers were really planning early on to bring him back, they would have at least foreshadowed it in some way, however subtly. But they didn’t do that. And on top of that, they didn’t ask Ian McDiarmid to come back as Palpatine until a point in 2018 when the production of TRoS was already well underway. All signs point to Palpatine’s inclusion being a last-minute choice.