Before being transferred to Brooklyn, Detective Desormeau was part of the Queens Gang Squad, a plainclothes unit assigned to get guns off the street. He often worked with Detective Neve. In interviews, several people who encountered the two detectives said that of the two, Detective Desormeau had the higher profile. He struck people as more outgoing and he was the one with the skill for cultivating informants. That in turn gave him control over the cases they pursued and also meant that he was the one whom those arrested tended to remember most vividly. His pitch was blunt: He would pay them thousands of dollars to give up the names of people who had guns, according to one woman he tried to enlist.

Detectives are sometimes reluctant to disclose an informant’s existence to a prosecutor or judge, concerned the informant’s identity could be compromised. That instinct may be what landed Detective Desormeau in trouble with prosecutors.

Through an informant, Detective Desormeau heard of a gun kept at an apartment in Washington Heights in Upper Manhattan, far from where he usually worked, according to the version of events that prosecutors have pieced together. Instead of bringing the informant to a judge to request a search warrant, Detectives Desormeau and Neve are accused of barging into the apartment on Nov. 6, 2014. They found the gun.

The detectives provided an account of the search whose details the Manhattan district attorney, Cyrus Vance Jr., described as fabricated “seemingly out of thin air.” The detectives claimed they were flagged down by a man who said his neighbor had just threatened him with a gun. When the detectives knocked on the neighbor’s door, the neighbor emerged with the gun visible in his waistband.

That story came under scrutiny as prosecutors learned more about the supposed witness, who the detectives said had flagged them down. Detectives Desormeau and Neve described him as a stranger who had approached them out of the blue. But prosecutors in Manhattan learned that their counterparts in Queens were under the impression that same man was an informant for Detective Desormeau who helped with gun cases, according to an internal memorandum filed by an assistant district attorney in Manhattan that was read to The New York Times.

Later the Manhattan district attorney’s office discovered surveillance video and text messages that further undermined the detectives’ account, according to the memorandum .

The episode led prosecutors to charge Detective Desormeau and his partner.

By then, the Queens district attorney’s office had begun to re-examine the two detectives’ account in a drug case, a review that led to the second perjury indictment against the officers. In that episode, Detective Desormeau claimed to have watched a man deal drugs near a restaurant in Jamaica, Queens. Detective Desormeau testified that he stopped the man outside the restaurant, searched him and found a bag of crack cocaine tucked behind his waistband.