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.
JJ is famous for his mystery box ideas. What I was saying is that it is likely he had in mind bringing Palaptine back as part of that, but he originally didn’t intend to be involved in IX. When he got involved that the idea was there. And considering the schedule, 2018 is not a surprise. That is when we found out Williams was coming back as well. So that timing fits with the general casting of the movie. You write the movie and then cast the actors. I think it is only foreshadowed by Rey’s theme being based (partially as you say) on Palpatine’s theme, but Abrams isn’t big and pre-planning the solultions to his mystery box ideas. Too much time in TV so he leave them open in case someone else is charged with crafting the solution. I’d claim this is another flaw in TFA, not TROS.