Jillian Snider, a former police officer who once worked under Chief Maddrey, said the chief gave Ms. Rachlin extensive access to the Police Department and described him as “one of the most community-oriented police officers that I’ve worked with in my whole career.”

But as crime rates rose after the coronavirus pandemic, top department officials began pulling back from engaging with criminal justice reform activists, she said.

“There has to be a line drawn on working in partnership with the community or being in a position where the community is trying to tell you: ‘Law enforcement, this is how you should be doing your jobs,’” Ms. Snider said.

Ms. Snider, who is now a lecturer at John Jay College of Criminal Justice and a policy director at the R Street Institute, a center-right think tank, believes the antagonism from police officials on X was sparked by emotions over the killing of Detective Jonathan Diller, who was fatally shot during a stop in Queens on March 25.

Still, she said she was shocked to see the public spats materialize online.

“I would encourage high-ranking officials to be prepared to be criticized,” Ms. Snider said. “It comes with the position that you’re in.”