During the final battle of Avengers Endgame, the 2014 Thanos variant managed to get his hands on Tony Stark’s Infinity Gauntlet with the six gems borrowed from the past. The Mad Titan declared he would undo the whole universe and build a brand new one, before Iron Man managed to transfer the Infinity Stones to his suit and snap his fingers, turning Thanos and his forces into ash. Of course, this action came at the self-sacrificial cost of Tony’s life, but now an alleged plot hole claims he still could have defeated the Marvel villain without having to die too.
Back in Avengers Infinity War, Doctor Strange used to the Time Stone to view every possible future reality out of 4,000,605 and in only one did the superheroes defeat Thanos.
This is why the sorcerer willingly gave up the Time Stone in exchange for Tony Stark’s life, as Iron Man needed to live so that he could die in five years time.
On the Avengers Endgame final battlefield, Doctor Strange reminded Tony that there was only one chance to defeat the Mad Titan. This means that even if Iron Man managed to get away from Thanos and give the Infinity Gauntlet to someone more powerful, then even then the Avengers would still have ultimately been defeated.
It was only in the reality in which Tony snapped his fingers in that moment, which would prove fatal for him, would they be victorious.