Everyone agrees: Friday’s incident at the Brooklyn HRA office, where cops fought to pry a baby from his screaming mom, should never have happened. And there’s a ton of blame to go around here.

Police Commissioner James O’Neill immediately ordered an investigation into the nightmare, and rightly so: His officers’ use of force to wrestle away the child — a 17-month-old baby! — looks massively excessive.

Yet the mom, Jazmine Headley, reportedly refused to move from the floor where she was sitting. As patrolmen’s union chief Pat Lynch notes, “The event would have unfolded much differently if those at the scene had simply complied with the officers’ lawful orders.”

Headley’s lawyer, Lisa Schreibersdorf, argues that, with no chairs available, her client was forced to sit on the floor after standing nearly four hours waiting to discuss benefits with an HRA agent.

But Teamsters Local 237 boss Greg Floyd, who represents HRA guards, says his members told him there were open chairs. And Headley, he added, bit one of the guards.

OK, there may well be more to the story than what’s seen on that viral video. Yet surely the cops and the guards could’ve tried harder to defuse the situation.

Why call in the police rather than an HRA social worker to calm the mom down? And what of the de-escalation training the NYPD rolled out after the fatal 2014 takedown of Eric Garner as he resisted arrest? It clearly didn’t help much here.

HRA also bears blame for operating centers that get so overcrowded and forcing clients to wait so long. The average wait runs a full hour, the agency says; that means some go far longer. That’s not only inhumane; it invites just the kind of chaos that erupted Friday.

Noting that “this indictment should have been handled differently,” Brooklyn DA Eric Gonzalez has dropped all charges against Headley. In fact, everything in this mess should’ve been handled differently.