In that crash course of MCU history, Doctor Strange had to have seen Tony’s big speech in Avengers: Age of Ultron, and saw that not only was Stark right in his assumption, but he was the perfect hero for the job.
As the Sorcerer Supreme/guardian of the Time Stone, Doctor Stephen Strange was the key architect in the solution to Avengers: Endgame.
And he found out exactly what it was in store for everyone by viewing all 14,000,605 scenarios that were possible after Thanos’ quest truly got underway in Avengers: Infinity War.