Avengers: Infinity War doesn't waste any time in killing off major characters. The opening scene alone includes the deaths of Heimdall (Idris Elba) and Thor's adopted brother Loki (Tom Hiddleston). To avoid a leak of the deaths from the very outset of the film, however, a fake version of the screenplay had Loki avoiding Thanos' strangling wrath by hitching a ride in an escape pod.
"We created a version of the script where Loki would get away in an escape pod at the beginning of the movie," Tran said. "When we started shooting that particular sequence, we had crew members who were thoroughly confused. We had to let them know that those were fake versions of the script that they read."
In the lead-up to the movie's release, it became common knowledge that the Russo Brothers disseminated false information to the cast so as to avoid leaks. In particular, Tom Holland (Peter Parker/Spider-Man) was very much kept in the dark due to his hilarious habit of unintentionally blurting out key information at the most inopportune moments. When it came time to film the scene in Wakanda when characters begin to disappear from Thanos' snap, the cast was only informed at the very last second that day on set.
The death of Loki is the impetus for Thor's entire character arc throughout the film. He starts off telling Thanos that he'll "die for that," and he makes good on that promise when he shows up with Stormbreaker in Wakanda. The only problem is that he didn't aim for the head, causing us to shake ours.