Five years ago, Marvel Studios was struggling to recapture the success of Avengers: Endgame and released one of its most divisive films ever.