Amazon is poised to pull out of distributing Terry Gilliam’s “The Man Who Killed Don Quixote” in the United States, Variety has confirmed.

The film has been embroiled in an ongoing legal dispute over its ownership. A court decision on whether it can be screened at this year’s Cannes Film Festival is expected Wednesday.

Amazon’s decision to drop U.S. distribution of “Don Quixote,” which was first reported by Indiewire, adds to the film’s star-crossed history. Gilliam started shooting the picture in 1998 with Jean Rochefort as Quixote and Johnny Depp playing a marketing executive who is sent back in time. However, shooting stopped after Rochefort became ill and the film was riddled with financial difficulties and insurance problems.

Gilliam’s tortured production was the subject of a 2002 documentary “Lost in La Mancha.” The director tried to re-start the film at several different points, with the likes of Robert Duvall, Michael Palin, John Hurt, Ewan McGregor, and Jack O’Connell all getting attached to the production and falling out as delays mounted and funding fell through.

The completed film stars Adam Driver, Jonathan Pryce, and Stellan Skarsgård. Amazon signed on to distribute the film in 2015. However, Roy Price, the head of the company’s entertainment operations and the man who approved the deal, was ousted last fall in the wake of a sexual harassment scandal. Amazon has been re-examining the types of films it makes and distributes in his absence.

“The Man Who Killed Don Quixote” was recently at the heart of a legal spat between Gilliam and the film’s former producer Paulo Branco. When unveiling Cannes’ official lineup last week, the festival’s artistic director Thierry Fremaux spoke about the film’s legal troubles and suggested it could be added to the slate later. “This movie – as well as others – is in a conflict that’s been brought to the courts,” Fremaux said.

A French court dismissed the request by producer Branco on Wednesday to stop Cannes from screening the film, clearing the way for the festival to press ahead with its closing-night plans.

Gilliam has also been battling health issues. He reportedly suffered a minor stroke over the weekend and was hospitalized.

A spokesperson for the director declined to comment on his reported hospitalization but said, “We can confirm that Terry Gilliam is currently at home preparing for his trip to Cannes next week in support of ‘The Man Who Killed Don Quixote.'”

RELATED CONTENT: