As a counterpoint to my last post, I was thinking about some fine trilogies that instead dip in the middle.
Good examples are Die Hard (1-3) and Star Trek (II-IV). In both cases I think what's going on is that the first film is a surprise hit, causing the followup to want to replicate the same 'feel', tone and/or plot.
Die Hard 2 is basically a (pale) imitation of the first, with the skyscraper setting swapped for Dulles airport. However, it must be said that compared to Die Hard 4 and 5, the first sequel looks like Citizen Kane.
Returning director John McTiernan rounds off the trilogy with Die Hard: With A Vengeance, which was a reworking of an original script called 'Simon Says'. The limiting cop-trapped-in-a-building formula was swapped for a fun buddy-movie setup with Samuel L. Jackson in fine form as John McClane's reluctant partner Zeus.
Similarly, Star Trek III: The Search for Spock stumbles by trying to recreate the tense, moody feel of Wrath of Khan.
With the reset button pressed and Spock restored to his body, The Voyage Home is free to lighten up and have a sense of humour. Eschewing any forehead-makeup aliens, starship battles or treknobabble it's as close as Star Trek has ever gotten to a straightforward comedy. And it has whales.