A deleted scene released on Disney+ finally explains how Doctor Strange was able to see beyond his own death in Avengers: Infinity War. The Masters of the Mystic Arts are sworn protectors of the Time Stone, and over the centuries they've mastered its use. The Ancient One had used the Time Stone to identify countless potential threats, and to work out the best way to deal with them.
Doctor Strange did the same in Avengers: Infinity War, using the Time Stone to explore over 14 million different futures and identify just one in which the Avengers managed to defeat Thanos. But attentive viewers noticed one problem with this idea; because according to the Ancient One, it was impossible for her to see beyond her own death. Doctor Strange was one of the snap victims, killed by Thanos but brought back to life thanks to the Avengers, and he really shouldn't have been able to see beyond his own death.
Marvel has exclusively released a number of deleted and alternate scenes on Disney+, and one of these finally resolves the problem. It's an alternate version of the conversation between the Ancient One and the Hulk in Avengers: Endgame, and it reveals that she somehow managed to foresee the snap. The Ancient One explains that there's a key difference between killing someone, and doing what Thanos did, which she describes as willing people out of existence. The scene has some notable continuity problems, and of course Marvel replaced it, but it's the closest Marvel has ever come to explaining the mechanics of the snap. It neatly resolves the issue of Doctor Strange's mysterious visions; he was never looking beyond his death at all, because in any timeline where the snap was not averted, he and half the life in the universe never truly died.
The irony, of course, is that Marvel probably didn't mean to implicitly fix a plot hole. Instead, it looks as though Avengers: Infinity War and Avengers: Endgame writers Christopher Markus and Stephen McFeely had forgotten the rule that sorcerers can't use the Time Stone to see beyond their deaths. Even this alternate scene sees the Ancient One discussing events that would happen after her death in Doctor Strange, after all.
Meanwhile, it will be fascinating to see how the Masters of the Mystic Arts operate without the Time Stone, their greatest weapon. The Ancient One feared that any timelines without the Infinity Stones were vulnerable, in large part because of the way the Masters of the Mystic Arts had been using the Time Stone. She even took the Time Stone into battle, wearing it around her neck when she fought against the Chitauri invaders in Avengers: Endgame. Using the Time Stone, the Masters of the Mystic Arts were able to be proactive in their defense of reality, rather than reactive. But that advantage is now gone, which could cause major problems in Doctor Strange in the Multiverse of Madness.