After Endgame, the plan was for Kang, a villain from the future, to come back in time and fight the avengers. Immediately after Endgame, the TV show Loki introduced Kang in an unexpected way, where he had already been defeated by himself from a different universe. The winning Kang decided to destroy the multi verse so he would be the only Kang, and so no evil Kangs would exist. Loki kills him, thus re-creating the multi verse, and unleashing Kang to the world. In Ant Man, a bad version of Kang is the main villain, but at the end we see a bunch of other Kang's gathered in a group saying "Oh great, that particularly bad Kang is dead, now we can start taking over". This was supposed to reach its climax in "Avengers: The Kang Dynasty", which was supposed to be the next Avengers movie.
Unfortunately, the actor for Kang, Jonathan Majors, was arrested for assault of his girlfriend, and eventually lost a civil court case for it. Marvel dropped him as the actor for Kang, and since their entire story revolved around hundreds of versions of this guy, they had to make a hard pivot. Now, Robert Downey Jr. will return as Dr. Doom, presumably as a "What if Iron Man became evil in another universe" sort of thing. There was a solid year or so where no one knew what was happening next for Marvel because we knew they canceled Kang, but had no idea what they would do instead. The end result is this era of movies seem to be pointing in several different directions all at once, whereas previously there was a coherent plan forward the whole time.