It’s often said, with good reason, that a prosecutor could indict a ham sandwich, given the generally one-sided nature of the grand-jury system.

Which makes it all the more surprising that a Bronx grand jury has refused to indict a cop who shot a teen dead in the bathroom of his own home, in a case that has been compared to that of Trayvon Martin.

An earlier grand jury indicted Officer Richard Haste for manslaughter in the 2012 death of 18-year-old Ramarley Graham. But a judge threw out those charges because prosecutors mistakenly instructed jurors to disregard testimony that other cops had warned Haste — wrongly, as it turned out — the youth might be armed.

When Haste caught up with Graham in the latter’s apartment, the youth was flushing marijuana down the toilet. When Graham did not comply with the cop’s demand to “show me your hands,” Haste fired, believing Graham was reaching for a gun.

Bronx DA Robert Johnson said he was “surprised and shocked” by the decision.

He’s not the only one.

This is The Bronx, after all, where juries are less inclined to believe cops, and where the DA has never been shy about pursuing allegations of police corruption. Not to mention how unusual it is for a grand jury to decline all charges in a case where an earlier panel had voted for manslaughter.

True, this time the grand jury had the previously excluded testimony, as well as the emotional, precise and hours-long account of that day from Haste himself. And the US attorney’s office has announced it will review the case for possible federal civil-rights violations.

On the state level, though, there’s only two possible explanations for the exoneration: Either the district attorney’s office blew it.