Way before Avengers: Endgame, the Marvel Cinematic Universe was a huge risk
https://www.cnet.com/news/why-the-marvel-cinematic-universe-was-a-huge-risk-avengers-endgame/
2008's Iron Man, the first MCU film, was far from a guaranteed hit. For starters, the Iron Man character had never appeared in a movie or live-action TV show, putting him behind the likes of Spider-Man and the Hulk in terms of general public awareness. And the big thing at the box office back then was the gritty and grounded Dark Knight series, which self-consciously played down Batman's more comic book-y elements. Colorful and fantastic movies like Green Lantern and Ang Lee's Hulk were just as likely to flop as they were to hit big.
As if that wasn't enough, Marvel brought in two guys to head up Iron Man who were definitely unknown quantities.