An episode of Marvel's What If…? suggests there was a different way to deal with Thanos than what happened in Avengers: Endgame.