Sony Pictures and the filmmakers responsible for “Peter Rabbit” have issued an apology for what some parents complain is an insensitive depiction of food allergies in the new children’s movie.

One scene portrays the film’s computer-generated rabbit stars throwing fruit at a garden owner who is allergic to blackberries. Using a slingshot, the rabbits fire a blackberry into the mouth of Tom McGregor, played by Domhall Gleeson, leading him to convulse, collapse, and inject himself with an EpiPen.

Attempting to draw laughs from slapstick comedy hinging on a character’s food allergy did not sit well with some parents of real children who suffer from similar afflictions.

“During an allergic reaction, patients require the life-saving drug epinephrine and must go to the nearest hospital for follow-up treatment. The very real fear and anxiety that people experience during an allergic reaction (often referred to as an impending sense of doom) is a serious matter,” Kenneth Mendez, president and CEO of the Asthma and Allergy Foundation of America, said in an open letter to Sony executives.

The letter also accused Sony Pictures Animation of misrepresenting food allergies as a punchline in “The Smurfs" and “Cloudy with a Chance of Meatballs.”

Parents also took to social media, accusing the film of promoting bullying of children with allergies and mocking a life-threatening medical condition. Some even called for a boycott.

“Absolutely disgusting,” tweeted Chris Vaccaro, a journalist and a professor at Hofstra University. “My son suffers from severe food allergies, and on top of my wife and I worrying about that every second of the day, now we have to worry about a film where his allergy and lifestyle is mocked?”

That backlash promptly generated its own backlash from those accusing the film's critics of taking a comedic scene in a semi-animated movie way too seriously.

Still, parents stressed that their children’s allergies can have an enormous negative impact on their lives and should not be minimized.

“I’m pretty sure Beatrix Potter will be turning in her grave about now,” one outraged mother, Sam Rose, told the New York Times. “Allergies are often not taken seriously enough anyway. To have them trivialized on the big screen by such a popular character is immensely disappointing.”

By Sunday afternoon, producers of “Peter Rabbit,” which grossed $25 million in its opening weekend, appeared to have gotten the message.

“Food allergies are a serious issue. Our film should not have made light of Peter Rabbit’s archnemesis, Mr. McGregor, being allergic to blackberries, even in a cartoonish, slapstick way,” said a statement to the New York Times attributed to Sony Pictures and the makers of “Peter Rabbit.”

They added that they sincerely regret not being more sensitive and "we truly apologize."