Call it Larry Byrne’s epiphany.

Byrne is the NYPD’s deputy commissioner of legal matters. A former federal prosecutor, he’s a smart and slick guy.

As the federal corruption probe into the NYPD’s top ranks unfolded — 10 chiefs and inspectors have been transferred or reassigned in a suspected favors-for-gifts scheme — he preposterously claimed that the NYPD began probing the corruption around the same time as the federal authorities.

Around this time, Byrne had a revelation. He claimed to have discovered that the NYPD is actually prohibited from releasing disciplinary records of cops, which for at least the past four decades the NYPD made public through its personnel orders.

“Knowing that this was public, let the rank-and-file know that certain behaviors would not be tolerated,” a longtime anti-corruption official said.

Byrne cited something known as state law 50-a. The law prohibits police, fire and corrections departments from releasing personnel records of its officers. He said the NYPD had misinterpreted the law.

Outgoing NYPD Commissioner Bill Bratton, who since returning to the NYPD in 2014 has touted the department’s “transparency,” went along with Byrne. “It is a state law that we and every other police department in this state are obligated to conform to,” Bratton said last week. “It was a lapse in oversight on our part brought to our attention, and we corrected it.”

His transparency turnabout is nothing compared with that of Mayor Bill de Blasio. As public advocate, de Blasio was all for transparency in government. Since becoming mayor, he seems to be on an anti-transparency crusade.

Check out his stance on a lawsuit involving one of the most racially contentious issues of his administration — the 2014 “chokehold” death of Eric Garner in Staten Island by Officer Daniel Pantaleo.

That lawsuit, known as Luongo v. Civilian Complaint Review Board, resulted from a Freedom of Information request by the Legal Aid Society for Pantaleo’s history of substantiated complaints. State Supreme Court Justice Alice Schlesinger in Manhattan ruled the CCRB must produce the records.

But City Hall appealed Schlesinger’s decision. The case is now before the Appellate Division.

Last week, de Blasio told WNYC radio host Brian Lehrer that he supports changing law 50-a to provide more transparency.

Who’s he kidding? Why not simply order incoming NYPD Commissioner James O’Neill to release the personnel orders as the department had for the past 40 years?

“He’s hiding behind the statute,” said Chris Dunn, associate legal director of the New York Civil Liberties Union. “If police transparency depends on the New York State Legislature, we’ll all be long gone before the statute is changed.”