What movies still manage to be good overall despite a genuinely weak ending?
This is a common enough problem with comedies (hey there Stripes) that have to impose some sort of half-baked plot on a looser framework at the last minute, which ends up not being as fun as the shaggier riffing from before. So I would reserve the comedy examples for those that unravel completely and focus more on dramas, where a bad ending is much harder to overcome.
Sunshine is a big one for me. It is marred somewhat by the need to introduce a villain for the end even though the movie had managed to be a terrific thriller without one (no mean feat) for the fist 2/3rds. And things get a little esoteric at the very end, which doesn't bother me overmuch, but I can see how it is sort of an awkward fit for the movie that precedes it. Still, that movie that comes before is incredible, enough that I still recommend it as a good movie. But it would be a classic with a better ending.
Batman Begins is another, although that third act has been beaten to death around here. It still a solid three stars in my book based on the first half.
Recently, Silver Linings Playbook really soured for me at the end as it abandoned all the serious, messy issues it raised in the body of the film in favor of typical romcom claptrap. A big dance-off is how you save the rec center from becoming Old Man Petersen's boat house, it's not how you overcome legitimate mental illness. I think if I could recalibrate my expectations and approach it as a simple romcom it would come off as a very good one, but I would've preferred to see all of the David O. Russell movie that the first hour promised.