“Dramatically speaking for filmmaking, it’s much more interesting to be nuanced,” he said. “Even Darth Vader has a good side, otherwise he wouldn’t be interesting.”

But he says he knew it was risky to go to Israel, which he said Lebanon considered “the ultimate Darth Vader.”

Indeed, history has left many Lebanese with a deep hatred of the Jewish state.

Its creation in 1948 sent waves of Palestinian refugees across the border into refugee camps that evolved into permanent settlements. Israel also occupied southern Lebanon for nearly two decades, backed factions in Lebanon’s civil war and fought a 34-day war with Hezbollah in 2006 that killed hundreds of people.

The animosity has led to laws forbidding Lebanese citizens from traveling to Israel and from associating with Israelis, although the authorities often look the other way when Lebanese with second passports make quiet visits. (Mr. Doueiri traveled to Israel on his American passport.)

The ban on engagement with Israel often creates effects in Lebanon’s cultural realm.

The government has banned Israeli films, like the 2008 movie “Waltz With Bashir,” an animated autobiographical drama about the Israeli invasion of Lebanon in 1982. This year, it banned “Wonder Woman” because its star, Gal Gadot, had been an Israeli soldier.

In that light, many Lebanese saw an extended trip to Israel by one of the country’s most prominent filmmakers, a trip that involved paying Israeli actors and crew, as a step too far.

“We are in a war with Israel, and when you are in a war, you can’t deal with them like a neighboring country,” said Pierre Abi-Saab, deputy editor in chief of Lebanon’s Al-Akhbar newspaper, which has led the criticism of Mr. Doueiri. “So when a filmmaker goes, an intellectual, and says, ‘Brother, we are with peace’ — what peace? Whose peace?”