Before Zachary Levi was cast as the DC Comics superhero; Shazam! Levi was already starring in another superhero role in the form of Fandral in both Thor: The Dark World and Thor: Ragnarok.
However it was not a happy ending for Fandral in the MCU as in the closing chapter of the Thor trilogy: Thor: Ragnarok, the character was unceremoniously killed off alongside the other members of The Warriors Three from the films. However Levi is actually rather glad that this character choice was made.
“When I got cast as Fandral in Thor: The Dark World, though I wasn’t able to do it, I knew that the characters of The Warriors Three could be really fun characters if they ever developed them. They just didn’t. They didn’t.”
Zachary Levi then went on to say:
“If Fandral didn’t die, I might still be under contract with Marvel and I never would have been able to get this job. And I say f— that! This is the coolest thing ever. I’m so happy.”
So it appears that Levi is not to bothered in regards to his character being killed as he knew there was not much room for development in the larger context of the Marvel Cinematic Universe, and had he not been killed off, he may not had been able to land the Shazam! role which could turn Levi into a globally recognised movie star.
Shazam! arrives in theatres on April 5th 2019.