I think this article makes a very good point: it’s not the ending that messes everything up, it’s the pointlessly meandering middle. Nothing of consequence happens until the finale, which on its own is actually fairly solid IMO, if uninspired.
The ending is good in the abstract, but it’s not very balanced, and a lot of the action blends together. Compare it to Return of the Jedi, where the three fields of battle have clear distinctions and plots that allow each of the primary characters to shine.