The call went out as a Code 100, a sex crime: A man was masturbating in a gray Hyundai near some children on a street in Borough Park.

Responding to the radio alert, several members of the Brooklyn South Safety Patrol, a Hasidic watch group, hopped into their vehicles and headed toward the scene. Arriving in their uniforms and skullcaps, they surrounded the Hyundai, but the driver tried to flee. When they chased him down and tackled him, the man pulled a gun. Four of the patrolmen — known as shomrim for the Hebrew for “guards” — were injured in the melee. In the days that followed, they were hailed as heroes by a parade of politicians.

That was in September 2010. But within three years, as the case of the gunman, David Flores, made its way to court, a very different narrative emerged.

When Mr. Flores went on trial, his lawyer argued that he had not exposed himself, but instead had been pre-emptively attacked and fired his gun only in self-defense. An audio recording entered into evidence featured a 911 call from a witness reporting that the shomrim repeatedly kicked Mr. Flores after dragging him from his car.