After Sandra Bland was arrested for a traffic infraction and later committed suicide in a Waller County jail in 2015, criminal justice reform advocates proposed reforms inspired by Bland’s case. Among the most important was a proposal to bar cops from arresting people for minor offenses punishable only by a fine. In 2017 law enforcement groups derailed the measure at the Legislature, even though it had broad support on both the left and right. But this year, the legislation looked like it would sail through. It had sixteen coauthors, including some of the most liberal and the most conservative members. On Wednesday, House Bill 2754 passed the House by a vote of 126 to 20.

But over the next two days, in an extraordinary series of events, the bill was brought back to the floor, killed, briefly resurrected, and then killed again, in a cloud of confusion and bad faith emanating predominantly from House Democrats. If it had been law in 2015, the bill might have saved Bland’s life. If passed by the Senate, it might have prevented as many as 40,000 people a year from being unnecessarily arrested.

Instead, it imploded and in the process became an object lesson in the many varieties of failure on offer at the Texas Legislature. House Bill 2754 died due to a toxic mixture of incompetence and bad faith in a lawmaking environment that speeds to a blur in the weeks at the end of the session, when it can be difficult for even veteran lawmakers to keep track of what’s going on on the floor. That creates fertile ground for mistakes and for interest groups to take advantage of those mistakes.

The trouble started just before the bill was passed, when its author, state representative James White, offered up a last-minute amendment. White is the only African American Republican at the Legislature, and it was in part thanks to his strong backing and the backing of other Republican groups that the bill had made it this far.

To understand what soon transpired, we’ve got to get into the weeds for just a moment. Bear with me. Currently, police have the discretion to arrest anyone for any Class C misdemeanor, minor offenses like traffic violations that aren’t punishable by jail time. The version of the bill that the House endorsed would have prohibited police from doing so except in a few specific circumstances, including instances when the person is an ongoing threat to public safety or when the officer has “probable cause” to believe the person “will not appear in court in accordance with the citation.” White’s amendment added an additional exemption in cases where the alleged offender fails to provide “appropriate identification” so as to allow the officer to write the citation.

State representative Shawn Thierry, a Democrat from Houston, rose to ask White about his change. If her nephew jaywalked on his way home from the neighborhood pool, could an officer arrest him if he didn’t have a driver’s license with him? White told the House that “identification” could include giving the officer a name, address, and date of birth.

It soon became clear that the two were talking past each other. Thierry incorrectly thought that White’s bill would expand the ability of police officers to arrest people for not having an ID. “The situation we have now is that they can do the warrantless arrests now with or without identification,” White pointed out. Cutting off Thierry’s questioning, he moved to vote on the bill. It passed easily.

But after the vote, Thierry and other Democrats continued to express their discomfort to White about the language of his last amendment. Scott Henson, a criminal justice blogger who advocated for the bill and wrote his own account of its failure, suggests that the amendment had been pushed by police groups like the Combined Law Enforcement Associations of Texas, or CLEAT, as a “poison pill” designed to stir up Democrats. If so, the tactic certainly worked. Several hours later, White bent to Democratic demands, making a motion to reconsider his own bill and redo the vote so that he could remove the language he had inserted.

Here’s where things got confusing. Before the bill could be passed again, Democratic state representatives Poncho Nevárez and Terry Canales blitzed the floor to speak to each other at the front and back mics. The bill needed to be killed outright, they argued. Nevárez amplified Thierry’s impression that the bill expanded, rather than constrained, police powers. “If the officer doesn’t like the cut of your jib,” Nevarez said, “he can now gin up the idea that you won’t show up, and for that you get thrown in the pokey.”

Canales backed him up. “If I’m driving home and I’m speeding and the officer believes in his mind that I’m not going to show up, he can take me to jail?” he asked incredulously. “This is what I think of that,” he said, ripping a piece of paper in half. The bill was “garbage.” It would result in many more arrests. “That’s your little girl, your son, your niece, your nephew,” he said. “If that’s the kind of Texas you want to live in, vote for this bill.”

It was a highly theatrical display, and one that seemed to miss a fundamental fact: Police can already make arrests for minor infractions, and White’s bill curbed that power, rather than expanded it. Instead of proposing changes to the bill to make it better, multiple Democrats rose to demand that the entire bill be deep-sixed.

State representative Erin Zweiner rose to ask Nevárez for clarification: things had moved quickly, and the motion to reconsider had come out of nowhere. “I suspect I am not alone in being a little bit out of sequence with what’s going on right now, so can I clarify, you’re speaking against the bill?” she asked. Yes, Nevárez said forcefully, speaking over Zweiner, “we’re on the bill now. I’m concerned about the bill.”

Then Thierry spoke again, expanding her critique of the bill. “This goes beyond the scope of anything that we could have fathomed constitutionally,” she said. When the vote to pass the bill a second time came down, it died 88 to 55. Just eight Democrats—those with the most knowledge of criminal justice issues—voted to preserve the bill.

So complete was the confusion that even some of the Blue Lives Matter Republicans who voted against the bill the first time, when it was framed as a restriction on law enforcement, voted for it the second time, when the floor debate depicted it as good for cops. Defeated and demoralized, White returned to his desk, where he started playing that night’s Houston Rockets game on his phone.

What happened? Many Democrats were simply confused or followed the lead of their colleagues. After the vote, Thierry wrote on Facebook that she had helped kill the bill because it expanded police powers, which is unequivocally untrue. Henson has suggested that it was all the handiwork of CLEAT. Many Democrats maintain warm relations with the powerful police union, and the confusion on the floor may have given them cover to vote down legislation they might have otherwise felt compelled to support.

“They took advantage of a moment, and that’s unfortunate,” said one Democratic representative who supported the bill, “and it’s unfortunate that someone was not able to explain this to Mrs. Thierry first.” Bottom line: Democrats preserved law enforcement’s ability to arrest people for minor offenses, a policing power that disproportionately affects African Americans and other traditional Democratic constituencies.

Afterwards, Democratic supporters of the bill fought to have a redo of the redo, a third vote. Initially, Democrats were optimistic it could be done. But White was reluctant. White’s colleagues in the House say he was disheartened and felt burned by Democrats, doubtful that they would come through. But eventually he relented, and a re-redo was held on Friday afternoon. At first, it appeared as if the motion had narrowly crossed the two-thirds threshold needed to take up the legislation. But it soon became clear that so many Democrats were absent that the legislation would narrowly fail. It was a Friday, and many lawmakers had already left town, even though they knew a do-over vote might happen. Thierry was present and voted in support of reviving the bill, but the other Democrats who had spoken in opposition—Nevárez, Canales, Harold Dutton—were gone. Even Eddie Rodriguez, who lives in Austin, had skedaddled.

The bill always faced an uphill battle in the Senate, but the implosion in the House gives the Senate a strong reason to not even consider it. Its failure has a real human cost—tens of thousands of people might have been spared the experience Bland had in 2015. In the aftermath, some Democrats tried to shift the blame to White and House Speaker Dennis Bonnen for not trying harder to save the bill. But it wouldn’t have needed saving if Democrats hadn’t killed it twice, first by action and then by inaction. White recalled the bill in the first place, one advocate said, because “he was doing Democrats a favor, which is a mistake I imagine he’ll never make again.”