When director Stan Zimmerman decided to cast Latino actors in key roles in a new stage production of “The Diary of Anne Frank,” he never expected the controversy it would unleash.

Inspired by a news story about a Jewish woman in Los Angeles who created a safe house to shelter undocumented immigrants, Zimmerman intended the casting to draw a contemporary parallel to the immigration crisis in the United States. But when false reports surfaced that he also was replacing the Gestapo with Immigration and Customs Enforcement (ICE) agents, he became a target of haters on both sides of the political divide.

Although the publicity has brought attention to the production, which will open next month at the Dorie Theatre in Hollywood, “I would rather have not gone through all of that anxiety,” Zimmerman told the Journal in a break during rehearsals at his home in Los Angeles. “It’s very hurtful to get scary hate mail that’s either calling me a Nazi or a Holocaust denier. I know these are sensitive issues. As a Jew, I’m sensitive to [them], too.”

The play, based on a journal written by Frank while she and her family hid from the Gestapo in a “secret annex” in Amsterdam, has a script identical to the 1997 Broadway version that starred Natalie Portman. Zimmerman explained how the misconception likely arose.

“In our press release, we had an image of ICE. But we never said we were changing the script. People made the leap, and I think certain [outlets] had an agenda.” He cited right-leaning media including the Breitbart News Network and Fox News. “I was shocked when Deadline Hollywood just ran with that. No one called and asked.”

Genesis Ochoa, 16, and David Gurrola, 15, who play Anne Frank and Peter van Daan, have been trying to ignore the “people whose minds you can’t change. There’s no point in arguing with them,” Gurrola said of the internet trolls.

Both actors are of Mexican descent, and neither had read Anne Frank’s diary or the play before they were cast. Ochoa did not learn about the Holocaust in school, and Gurrola said there was “maybe a page” in his history book about it. But Frank’s story resonates with them, and they see parallels with the immigration crisis. “Not too far from us are safe houses, right in our backyard,” Gurrola said. “I have many relatives who are undocumented. Some were even deported.”

Playing Anne’s sister, Margot, is Teddi Schaffer, an Ashkenazi Jew whose mother grew up in Mexico. She isn’t surprised by the controversy, “but I stand behind the project,” she said. “It’s being done in a very respectful manner, all in the name of art and awareness.”

Schaffer grew up “culturally Jewish” in the predominantly Jewish community of Parkland, Fla., where Holocaust studies are part of the curriculum. She hasn’t been able to go back since the shooting at Marjory Stoneman Douglas High School in February, but she has vowed to fight for gun control legislation. “Activism has always been important to me,” she said. “All I care about is getting a platform for gun reform to help those wonderful kids.”

Zimmerman, who was raised in a Reform Jewish home in Southfield, Mich., a largely Jewish suburb of Detroit, revealed he was a victim of bullying, but not because he was Jewish. “As a gay kid, I experienced persecution. I was spit on at school,” he said, noting that the plight of mistreated minorities has always resonated with him because of it. He also has a strong connection to Judaism. “I’m so proud to be Jewish,” he said. “It’s the part of me that gives me humanity.”

Zimmerman, best known for writing for and producing “The Golden Girls,” “Roseanne” and “Gilmore Girls” on TV, has two new shows in the works: an office comedy about three sisters and their dad who run a baseball cap company, and “Silver Foxes,” which he describes as a “gay male ‘Golden Girls.’ ”

He has directed three plays in the last year, most recently the circumcision comedy “A Knife to the Heart.” With “Anne Frank,” he’s managing a much larger cast in a tighter stage space, marked by tape to delineate the doors and walls of the cramped annex. The costuming is of the period, he said, but stylized.

The play’s run is booked for only 15 performances, but Zimmerman would love to extend it or move to another theater. “I think it’s a great education tool, and I would love it to go to schools or have school groups come see it, since it’s not being taught anymore,” he said. “When I grew up, it was a required part of the curriculum.”

Zimmerman believes the play and the diary endure because of the writing. “It’s so beautiful and so moving that someone so young could be so insightful, that she could see the world like that.” he said. “You can’t help but be drawn into the story.”

Its takeaway message remains the same, Zimmerman said: “Never again.” But he also hopes his production and its casting provoke discussion about other issues of man’s inhumanity to man.

“There’s no way you can compare anything to the Holocaust,” he said. “But we can learn from it, open up and talk about issues, and ask ourselves how we can help.”

“The Diary of Anne Frank” runs Sept. 6-23 at the Dorie Theatre in Hollywood. Tickets are $25 online, $30 at the door.