Terry Gilliam’s “The Man Who Killed Don Quixote” has endured its latest legal hurdle.

The U.K.’s Royal Courts of Justice have ruled in favor of the Jeremy Thomas-owned Recorded Picture Company (RPC), and against France’s Alfama Film Productions and CEO Paulo Branco over a rights dispute relating to Gilliam’s 2018 film, which starred Adam Driver and Jonathan Pryce.

The dispute dates back to 2016, when RPC first entered into a deed with Alfama, giving them the option to produce the project. However, Branco and Gilliam’s relationship soon broke down and RPC eventually gave the option to Spanish company Tornasol, who went on to produce the film, resulting in years of disputes over who owned the rights to the project, amid an attempt by Branco to disrupt the film’s release.

However, in a ruling on Thursday, Deputy High Court Judge Hacon sided with Gilliam and the film’s producers, noting they “never had a substantial chance, nothing above a speculative chance, of making the film if RPC had not been in breach of the Deed.”

The trial had focused on whether Gilliam and Branco may have reconciled after the breakdown in their relationship during pre-production; and, even if there was such a reconciliation, would Branco have been able to raise the necessary finance for the film. RPC’s case was that both scenarios were not possible.

“I am sure that Mr. Branco hoped and expected to make the film and would not have invested time and money unless he did. But that is not to the point. The question is whether on the evidence I have seen events would in fact have led to the film being made with Mr. Branco as producer. In my view not,” said the judge.

“As I have said, I think that even if Mr. Gilliam had believed that Mr Branco had the finance in place, the chance of his being willing to continue working with Mr. Branco was very low. Even if desperation had driven him to try, in such a counterfactual he would, well before any prospect of the start of shooting, have come to realise that Mr. Branco was never going to raise sufficient money to make the film that Mr. Gilliam wanted to make. At that point he would have left and there would have been no film. Any chance Mr. Branco had of making the film would have fallen to zero.”

The “Don Quixote” saga began well before 2016. Shooting on the film had started in 1998 with Johnny Depp and Jean Rochefort as principal actors, but Rochefort became unwell and the project had to be abandoned. The ordeal was chronicled in the documentary “Lost in La Mancha,” released in 2002. Subsequently, the project passed through many hands before RPC came on board.

The film was eventually made with a cast including Driver, Pryce, Stellan Skarsgard, Olga Kurylenko, and Jordi Molla. The film closed Cannes in 2018, where it received mixed reviews. Amazon had boarded rights but backed out during the dispute over rights.

The case is still pending in French courts after Gilliam lost a long battle over the rights in 2018, with the Paris Court of Appeal ruling in favor of Branco. A further appeal is pending in the Court of Cassation.