NYPD Commissioner James O’Neill may or may not have made an amateur mistake — as Sergeants Benevolent president Ed Mullins put it — in perhaps prematurely criticizing the fatal police shooting of Deborah Danner, an emotionally disturbed Bronx resident, last year.

But O’Neill’s undisputed amateur mistake is that he accepted the interpretation of state law 50-a by Larry Byrne, NYPD deputy commissioner for legal matters.

Byrne’s interpretation deems law enforcement personnel records confidential. And O’Neill is now using Byrne’s interpretation to block the release of departmental trial decisions and videos, and the disclosure of transfers and promotions.

O’Neill, who, like Mayor Bill de Blasio, bleats about the importance of “transparency,” recently told the Daily News he is “hamstrung” by the law.

Rather, O’Neill has chosen to hamstring himself by accepting the new interpretation even though the NYPD released such information for decades.

And the mayor, instead of standing up to the department — specifically to the police unions, which seek to keep internal decisions secret — has gone along.

City Hall appealed a court decision ordering the release of trial decisions with officers’ names blacked out. The case was brought by the New York Civil Liberties Union and will be heard by the state’s top court next year.

“How does a judicial decision become a confidential personnel record? And how does it extend to police videos?” asked Chris Dunn, associate legal director of the NYCLU.

Granted that after millions of mostly meaningless stop-and-frisks under the 12 years of then-Commissioner Ray Kelly, many non-white New Yorkers don’t trust the cops. Granted, too, that an anti-police climate prevails across the nation, and that there is a universal rush to judgment against the police.

“In the long run, transparency is more important to the integrity of the department than pressure from the unions,” said a former top NYPD official, who spoke under the condition of anonymity to discuss 50-a.

And if O’Neill and de Blasio find themselves distrusted by non-white New Yorkers — despite all their talk about their neighborhood policing policy engendering trust — they have only themselves to blame.