Many young actors have fallen into the trap of being typecast, repeatedly asked to play a specific type of character across different productions. This is often the case with actors from underrepresented groups whose mere presence can be used to signal the inclusion of their specific ethnic or national sensibilities in the plot.

Thankfully, Riz Ahmed, a British Pakistani actor who has found success acting in films on both sides of the pond, has been able to escape the trap, playing a wide range of roles that prove his skill as an actor. He dazzled audiences in Sound of Metal, where he played a drummer who is slowly losing his hearing.

Amazon Studios was responsible for snatching up that film and releasing it on Prime Video, and this month, the same company will begin airing the Michael Pearce-directed Encounter, also starring Ahmed.

In this film, Ahmed plays Malik Khan, a Marine veteran who served 10 tours overseas. He’s separated from his wife, but he remains a fiercely loyal father who loves his two young sons, Jay (Lucian-River Chauhan) and Bobby (Aditya Geddada).

One night, Khan shows up at the family house in California and tells his sons they’re going on a road trip. They hop in the car, setting off in the middle of the night. Eventually, the sons start to wonder why their mother isn’t joining them and where exactly it is they’re supposed to be going.

Khan tells them that their journey isn’t just an impromptu vacation after all. He has secretly discovered an alien invasion and wanted to ferret his children away to a military base in Nevada. He couldn’t even risk bringing their mother along because she’s already fallen under the aliens’ influence.

This early twist leaves the viewer with a conundrum. Do we accept the reality that Khan has imparted to his sons — aliens are invading Earth, using bugs to insert parasites into the population to control them — or do we come to the conclusion that he’s lost his mind and is simply kidnapping the children?

Khan’s wife and the authorities believe it’s the latter, setting off a multistate manhunt that forms the bulk of the film’s 108 minutes. Along the way, Khan does his best to convince his sons that he’s rescuing them from imminent doom.

Whenever they encounter trouble on the open road, he tells them to be vigilant for alien presence. The boys douse themselves with bug spray over and over to avoid parasitic implantation.

If you’re a real film buff, you may recall another movie that revolved around a man’s fantastic predictions that led many to question whether he’s mentally ill. In 2011, Take Shelter, directed by Jeff Nichols and starring Michael Shannon, was about the patriarch of a family who kept having dreams of a coming storm. He took to building a storm shelter obsessively, exhausting his family’s resources and patience in the process.

That film keeps us guessing about whether those premonitions were legitimate until literally the last minutes. Encounter, on the other hand, tips its hand much sooner, which is a shame. But while the writing is weaker than Take Shelter, the chemistry between Khan and his children makes the film a rewarding watch.

Regardless of whether he’s protecting his children from parasitic takeover or experiencing a break with reality, he takes time to play with his sons and shield them from the harsh realities of what’s unfolding around them. It’s clear that Khan is a devoted father who cares deeply for his children.

That’s the argument that Hattie, played by Octavia Spencer, relays to authorities. Hattie is Khan’s parole officer. It turns out that he spent a couple of years in prison following an assault he committed while in the military. This information leads the FBI to insist that not only is Khan dangerous, but he might even be what’s called a “family annihilator” — someone who takes out frustrations by killing members of his or her own family.

To Hattie, Khan isn’t a man who’s on the verge of familicide. She sees the good in him and insists that the situation can be resolved peacefully. But as more and more chaos unfolds around the Khans during their trip, it’s not clear if that’s really a possibility.

Without giving too much away, viewers should know that Encounter is less a movie about an alien invasion or a high-stakes manhunt than a film about a father who will do anything for his two sons.

Some viewers may find themselves scratching their heads at some of the choices that Khan makes, and they may even decide that FBI agent Shepherd West (Rory Cochrane) is right to view his behavior with cynicism.

But just as life rarely gives us perfect situations, it also never gives us perfect people. Khan’s paternal bond to his children reminds us that even some of the most flawed people still have the capacity to love.

This is why we should applaud Ahmed’s determination to avoid typecasting. In today’s political climate, he could easily decide to play roles that portray characters who are virtuous victims. I’m sure he would’ve had no problem finding writers and directors who would cast him exclusively as a Muslim man laboring under discrimination and marginalization.

Instead, Ahmed has dedicated himself to embracing the full range of human experience. He hasn’t shied away from playing roles as a Pakistani Muslim who is trying to find his way in the Western world — his portrayal of Omar in Four Lions offered a compassionate depiction of a Muslim man pushed into radicalization — but he isn’t content boxing himself into a small corner of the world.

Ahmed’s choice to play flawed and textured characters from a range of cultures and backgrounds speaks to his strength as an actor; the continued box-office success of his nuanced films speaks to our strength as the audience.

Zaid Jilani is a freelance journalist.