As was typical for the new Star Wars trilogy, The Rise of Skywalker was plagued by director issues. Before J.J. Abrams took the job, a number of other directors were contracted to direct the film (including people like Colin Trevorrow).
Abrams wanted to finish the trilogy he started in spectacular fashion, something which he had the opportunity to do because of his duties as director, writer, and producer. And because of this, he decided that it would be best to include Carrie Fisher in the film despite the fact that she had died nearly three years before its release. Thus, he incorporated unused footage of Fisher into the film so that her story could be concluded in a meaningful way.
Naturally, because of the project's scope, it filmed for over seven months. Abrams felt an obligation to finish the stories of the characters who he - and fans across the world - held near and dear. Abrams, however, had a tight schedule on set, and some of the film's editing had to take place during filming - something which baffles fans to this day.