Last week, The New York Times published an investigation into police perjury within the New York Police Department that found that false testimony by the police, known as “testilying,” remains a problem. This year, a Queens detective, Kevin Desormeau, has been convicted of perjury and a Brooklyn detective has been charged with fabricating a photo lineup.

Even as Officer Moloney was arraigned, prosecutors offered little explanation about why they believe he lied. They also did not say if they suspect it had been his idea to lie or if he been instructed to lie by superiors. At the time of the gun arrest, Officer Moloney had been a police officer for three years. As contradictions in his account were exposed, Officer Moloney cited his inexperience as the reason for the error, prosecutors said.

The charges against Officer Moloney stem from an arrest he and other officers made on May 6, 2016, in the public housing apartment building where they had been seeking to arrest a man on a warrant for low-level charges. The officers knocked on the door of an apartment and arrested the man when he answered the door, prosecutors said.

Because it was early in the morning, the man was not properly dressed. The officers followed him into a bedroom to allow him to put on clothes. Officer Moloney and a second officer left with the man to process the arrest, prosecutors said, but about 15 minutes later a sergeant who had stayed behind told the officers to come back.

Inside the apartment was an open black box containing a gun as well as a few bags of marijuana, prosecutors said. At that point, the sergeant told Officer Moloney to go get a search warrant. But when Officer Moloney went to the Brooklyn district attorney’s office to apply for the warrant, he claimed that he — not the sergeant — discovered the gun.