When he played Millman in the third round, the 38-year-old rattled off six straight points in a match tiebreaker that looked lost.
His quarter-final against Sandgren, the world number 100, should have been a straightforward affair - but he found himself two sets to one down, with a suspected groin injury, and had to save seven match points in the fourth set before eventually defeating the American in the decider.
To perform one Lazarus act in a Grand Slam campaign is nothing short of freakish; to do it twice is miraculous.
US Open
Djokovic at US Open: America relaxes Covid rules - but star faces travel wait
Both Sandgren and Millman might be judged as mediocre opponents, although ones capable of springing an upset on the top players. Millman beat Federer in the 2018 Australian Open and Sandgren went into their quarter-final tie with an impressive 5-2 record against top 20 players in Slams.
But Federer's principal rivals for the title, Djokovic and his potential final opponent in Rafael Nadal, have come through much tougher tests unscathed. Federer is yet to play a seed in the tournament and has lost five sets; Djokovic and Nadal have played two apiece and dropped a solitary set each in their runs thus far.

Highlights: Federer mounts stunning escape to beat Sandgren in five-set thriller

Federer will point out that when he won his 18th Grand Slam at this very tournament three years ago, he was half-fit at best having missed the last five months of the 2016 season and had to come through two five-setters on his way to the final, where he again had to go the distance to beat Nadal for the title.
But the signs are worrying for Federer. Against Sandgren, his serve was uncharacteristically ineffective as he only hit five aces in the marathon encounter. Against Millman, his forehand broke down completely. Though they were ultimately unable to take full advantage of these weaknesses, a player of Djokovic's calibre will smell blood and pounce, particularly given his prowess on return and in lengthy rallies.
Then you must factor in Federer's recent record against Djokovic. His last victory over the Serb at a Grand Slam was as long ago as the 2012 Wimbledon semi-final. Since then, they have met at the Australian Open once, with Djokovic winning in four sets, and at Wimbledon three times, all of them in the final.
Federer will be keen to point out that he had spent more time on court than Djokovic prior to the last of those finals six months ago but still matched his rival for just under five hours and should have beaten the younger man, missing two Championship points in the epic fifth set, which Djokovic eventually won on a tiebreaker.
But near misses are not wins and he has only beaten Djokovic once since 2015, at the ATP Finals in their last meeting in November. That victory was fired by his first serve, which worked perfectly in a 6-4 6-3 win, so much to the extent that Federer only lost three points on serve in the first set and only faced one break point in the entire match.
Federer has had a knack of serving well against Djokovic in their last three meetings, with the last five sets the Serb has won against him coming via tiebreakers. But Federer's serving performance against Sandgren does not augur well for his chances of replicating the levels we saw in their two London encounters last year, or at the Paris Masters in 2018.

Djokovic routs Raonic to set up semi-final showdown with Federer

Djokovic himself has pointed out that he and Federer have a tendency to raise their levels when they face one another.
"We try to [surprise each other]," he told Eurosport after his win over Milos Raonic. "It's going to be the 50th time we meet on the court, next to Rafa he's been my greatest rival. In a way I know what to expect but whenever we get to play each other, we both try to raise our level and focus and we understand that we have to be at our best in order to win."
Djokovic has certainly shown signs of being at his best, not least in a comprehensive win over Milos Raonic in the last eight. The Canadian had entered the encounter having not dropped a set, or even serve, all tournament. Djokovic put paid to that with a comprehensive victory against a man who serves bigger and better than Federer.
So far in Australia, Federer's game has just not come together. He will need to make the most of his day of recovery before the semi-final, having been dragged into two unnecessarily long matches, not least if he felt tightness in his groin in the third set against Sandgren.
Then, somehow, he has to summon the energy and willpower to beat Djokovic on his favourite court and reach yet another Grand Slam final. Should he do it, it would be among the finest of his many achievements.
'An extraordinary line-up' - Tsitsipas, Ruud join Nadal, Federer, Djokovic, Murray for Laver Cup
ATP Montreal
'I have to follow the rules' - Why Medvedev thinks missing Wimbledon may help for US Open
09/08/2022 AT 07:59