There may never be another film like Avengers: Endgame, using time travel to give fans a trip back through the MCU they had watched take shape, to give heroes the ending they truly deserved. It was such a perfect ending, in fact, that few would ever think time travel was pitched and scrapped--before a business decision unintentionally changed everything.

Marvel's insistence on not letting their stories get too serious--even when avenging half the universe--has earned some criticism. But as it turns out, the need to keep comedy alive in the MCU (even after a universal genocide) ended up unlocking Endgame in a way nobody could have planned. Ant-Man's exile in the Quantum Realm, his return, and the time travel he discovered were the key needed for Endgame to bring the first decade of the MCU to a close... and it happened almost by accident.

RELATED: Avengers: Endgame Writer Confirms 'Old Steve' Cameo Theory

When it became clear that Infinity War might not go the heroes' way, many fans wondered what it would mean for Ant-Man and The Wasp, Paul Rudd and Evangeline Lilly's action-comedy sequel set to follow the event film. Marvel Studios, of course, had found a solution: leave Ant-Man and The Wasp out of Infinity War completely. It was a perfect fix, with a post-credits stinger explaining the film's events had kept Scott from being called upon by the Avengers. Not to mention a final twist showing why the cast wouldn't be around for the five-year time jump--but Scott could return before them in Endgame.

Ant-Man and Wasp prepare the quantum tunnel.

Fans didn't know at the time just how 'in flux' the story connections between Ant-Man and The WaspInfinity War, and Endgame actually were. Actress Evangeline Lilly even revealed that the Ant-Man cast filmed their 'snap' death scenes before they even knew what it meant. The decision was ultimately made to cut the deaths, keeping the film from getting too dark, and leaving Scott stranded on his way towards the Avengers sequel. After all, adding in painful, tragic, or even upsetting death scenes would call into question the decision to keep Scott Lang out of Infinity War in the first place.

As Endgame co-writer Christopher Markus explained during a panel at SDCC 2019, those business decisions to tied their hands with Infinity War... but it also opened a doorway for Endgame the writers had already slammed shut:

It was a bit of a problem. We knew we wanted the first movie to end with this [snaps fingers]. Then we had to figure out how to fix that. We didn't want a 'get out of jail free' card, we didn't want to find out he didn't actually do this, he did this. 'Time machine' comes up very quickly, the same way 'rocket jetpack' would come up. It's a cheesy science fiction idea that you throw out quickly and go, 'We can't do that, it's too stupid'...obviously it's not stupid.

But we had this great thing happen, which was: we weren't allowed to use Ant-Man in the first movie. Because there was an Ant-Man movie coming out in between Infinity War and Endgame, and if he was in Infinity War you would have a dark and depressing Ant-Man movie. Which is not what anybody wants out of a Paul Rudd movie, so we kept him out. But we were allowed to use him for the second one, which opened up Hank Pym and the Quantum Realm. And literally we just... I Googled 'quantum realm.' This is how great things happen.

Everyone over on the other side of the table in the conference room where we were trapped for months, this is Fall of 2015, were talking about something else. I Googled 'quantum realm' and... time is different in there. I think I sort of raised my hand and went, 'We can do a time machine! Because we have an excuse to do a time machine.' And that is around when cooler heads prevailed and brought in an actual physicist to tell us either we were crazy, or we were right, or that we were crazy but it was okay to do it because, you know, we're not making a documentary. And all of those things happened, and here we are.

They say that truth is stranger than fiction, and it seems Marvel Studios has proven it a fact. That, or introduced their own variation: that corporate demographic-targeting can make a writer's wildest dreams come true... or at least make them plausible to an audience. Even if it is by the rules they themselves get to establish.

This insight into the story behind Infinity War and Endgame is sure to be bittersweet for fans of Scott Lang and Hope Pym. On screen, Scott Lang has graduated to 'heavy hitter' among the Avengers, growing to gigantic size to battle colossal alien threats. Meanwhile, Hope has become a one of a kind hero, with the knowledge and nerve to not just join, but lead an all-female Avengers team. But despite all that, and despite their adventures into science fiction being the thing that even made Endgame's time machine possible, Marvel has yet to confirm any plans for another Ant-Man or Wasp adventure. There may be a place for Ant-Man in Marvel's future films, but it's seeming more and more likely that the franchise's greatest contribution to the MCU may be its barely-tapped Quantum Realm. Oh, and keeping Scott Lang out of Infinity War to let him be goofy. A less than desired legacy, to say the least.

In hindsight it's hard to imagine the writers ever ruling out the plot device which made Endgame's best moments possible. If the future of Ant-Man and The Wasp remains vague, historians will surely deem Ant-Man and The Wasp a disappointment compared to the other movies that released before and after. But at least MCU fans now know that they owe plenty to the more lighthearted team-up, since it proved to be the only thing that made Endgame's story possible. We doubt this fact will do much to raise their status among general audiences, but the Marvel die-hards will know--which is all that matters.

MORE: Kevin Feige Talks Quantum Realm's Role in The MCU's Future

Key Release Dates