I actually remember the movie trying so hard to fit all the original endings in that it just faded to black at least four times, seemed like it was over, then started right back up again.
Of course, Pellenor Fields did get replaced with a spooky ghost army and the best part of the book (Scouring of the Shire) was left out entirely. Not that it could ever have fit in there.
And of course the Sourging of the Shire could have fit in the movies, it was shown as a vision when they met Galadriel in the first movie. They had it set up and they changed their minds later on.
The ending in the movie is problematic because it follows some of the ends of the book without understanding why they are necessary -> they make Frodo leave Middle Earth but they never bother to explain WHY he has to leave. PJ clearly did not understand the books.