The state of New Jersey is suing Sig Sauer for breach of contract after the New Hampshire-based firearms manufacturer allegedly sold defective handguns to state police, The Trace reports.

The lawsuit comes on the heels of the U.S. Army’s recent decision to award Sig Sauer a half-billion dollar contract to supply its new service pistol, the Sig Sauer P320, which will replace the Beretta M9.

According to the complaint filed in late April, the New Jersey State Police tested 19 different handgun options in 2011 and ultimately settled on the Sig Sauer P229 9mm semiautomatic pistol, the sidearm often favored by the U.S. Coast Guard, Secret Service, and other law enforcement agencies across the country.

The department then ordered 3,000 models at a total price of $1,844,000 for its troopers, but when the pistols were fielded during a weapons qualification session in September 2014, many “sporadically exhibited a failure to extract,” a malfunction where an expended casing remains in the chamber after the weapon is fired.  

“Failure to extract,” of course, defeats the purpose of a semiautomatic pistol — and puts law enforcement officers in danger.

“An FTE malfunction renders a gun unfit for police use because a Trooper may be unable to fire more than one round of ammunition in a life-threatening situation,” reads the claim, which was filed by New Jersey’s attorney general.

Over 16 months that followed the September weapons qualification session, Sig Sauer allegedly tried to fix the problem by replacing various components in the defective weapons, but with no success.

It wasn’t until October 2015 that the state police finally identified the source of the problem: Turns out, Sig Sauer had supplied them with the wrong gun. The department had ordered the p229 Legacy, but were instead sent 3,000 models of the P229 Enhanced Elite — almost the same weapon, except with a different extractor system.

Problem solved, right? Nope. Once the replacement models were delivered to the state police, those, too, proved faulty. According to the lawsuit, the state police “randomly” selected 25 models from the new inventory for inspection and testing. Five were immediately red-lined “because they were so egregiously noncompliant with Sig Sauer’s specifications that they could no longer be used.” Five more were tested on the range. Three of them, the lawsuit claims, “exhibited numerous FTE malfunctions.”

With that, the state police decided to ditch Sig Sauer altogether, and, in 2016, fielded an arsenal of Glock 19 pistols to its troopers instead. The state of New Jersey is now asking for a full refund for the P229s it purchased, as well as $856,680.21 “for the cost of holsters purchased for the defective weapons,” and an unspecified sum to cover the money spent on ammunition to test the weapons.

But that’s chump change compared to the few hundred million dollars Sig Sauer is about to get from the Army. Hopefully, that transaction plays out a little more smoothly.