Carlos Lopez Estrada's debut taps into potent ideas about race in America, even as it struggles to make them work.

There’s a brilliant scene in “Blindspotting” in which Collin (Daveed Diggs), a few days before ending his probation, has a terrible nightmare. Sitting in a neon-red courtroom presided over by the police officer he recently saw kill a man, Collin faces a metaphysical trial that embodies every ounce of frustration in his fragile life. It’s a tense collage of one man’s cluttered mind, his disdain for a system piled against him, and nothing else in the movie can compete with it.

Directed by Carlos Lopez Estrada from Diggs and co-star Rafael Casal’s long-gestating, semi-autobiographical screenplay, “Blindspotting” offers up a handful of such astonishing moments throughout an otherwise straightforward look at two lower-class Oakland pals struggling to find their place in a sea of gentrification. Ultimately, the movie belongs to Diggs, a Tony winner for “Hamilton” who comes into his own as a genuine movie star with a fully realized performance that easily outshines the bumpier moments.

He’s complemented by his creative partner, Casal, as the pair bring a fascinating chemistry to the uncertainty that defines their lives. The introductory moments waste no time establishing a tight framing device to set the story in motion: Collin has three days left on his probation for an outrageous incident from his previous job; now, he works as a mover with his childhood pal Miles (Casal) as they whine about their challenging lives in between exchanging freestyle raps.

Miles is at once the more reckless of the pair — he giddily brandishes a handgun for no good reason — even as he attempts to maintain a stable family life with his girlfriend (Jasmine Cephas Jones) and young child. Collin has yet to make amends with his ex (Janina Gavankar), who oversees the moving company while keeping her distance whenever she can.

The women are unfortunately sidelined in a plot that has little to do with them; on the other hand, the male leads who dominate the movie aren’t dominant figures, either; responsibility eludes them at every turn. “Blindspotting” lingers on Collin’s rocky existence with a fascinating and unpredictable air. When Collin witnesses a burst of violence early on, it provides an all-too-tidy excuse to illustrate the racial dynamics of the scene that barrel down on him. But the maximalist approach injects the movie with palpable suspense that reflects Collin’s mindset: He fears, for real reason, that at any given moment his entire life could collapse.

Casal, a hot-blooded white man who behaves like a crude inner-city caricature, serves as a blunt wild card to animate Collin’s broader conundrum: He’s a black guy with dreads who gets pigeonholed in the worst possible way, even though his best friend acts a whole lot worse. This dynamic simmers in their scenes together, until it finally bursts in a climactic showdown that’s at once inevitable and terrifying for the authentic rage Diggs brings to the scene.

Unfortunately, “Blindspotting” is continually marred by the fancy trickery of a filmmaker incapable of reining in the material, as split screens, an exuberant flashback, and flashy transitions constantly get in the way of letting the stronger exchanges stand out. The movie’s middle section struggles from a listless quality, as if the screenwriters found themselves incapable of writing a second act and simply gave up until they arrived at the third one. Clumsy bursts of violence that complicate the scenario materialize out of nowhere, and a ludicrous twist at the very end threatens to derail the more credible moments leading up it.

But Diggs carries it through the finish line, juggling extraordinary monologues that border on poetry as his eyes throb with outrage. Estrada frames his plight by transforming Oakland into a tantalizing vessel for America as a whole — decrepit streets sitting side by side with posh neighborhoods, a class-based system in denial about itself.

However, the ultimate success of “Blindspotting” comes down to the intensity of emotion percolating beneath each scene, with Diggs’ face exuding fury for an unjust world that has no use for his goodwill. He’s a striking embodiment of what it means to feel marginalized in modern times, a figure dominated by a blend of fear and anger so deeply entangled they become indistinguishable, and the only catharsis lies in living through another day.

Grade: B-

“Blindspotting” premiered opening night in the U.S. Competition at the 2018 Sundance Film Festival. It is currently seeking U.S. distribution.

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.