I saw Rogue One last week and was blown away by the ending. Looks like even the writers of the movie had doubts about Disney accepting the ending where everyone dies.
We always felt that it was the right thing to do, that these characters make the ultimate sacrifice. It wasn’t that way in my original script, but again, we never felt that we would get away with it. K-2 always died, but Jyn survived in the very first version of the movie that we developed, and then it was Gareth who kept pushing for it, saying, “I feel like they need to die. They need to die.” Eventually he convinced [Disney and Lucasfilm].