Although most of the country just became aware of issues with Oklahoma's capital punishment protocols last week after Clayton Lockett's bungled execution, his lawyers had been worried for months. That's because in January, two condemned men in different states but injected with the same new drug cocktail endured executions that went badly. Lockett's lawyer, Susanna Gattoni, was unable to keep him from suffering a similar fate last week.

"We were alarmed by a Ohio execution that was actually the same protocol that was used for Mr. Lockett. We were alarmed by an execution that happened in the state of Oklahoma where he said, 'I feel my whole body burning.' We were alarmed by the fact that the source of the drugs was secret," she says.

Gattoni represents not only Lockett but also Charles Warner, next in line on Oklahoma's death row. Oklahoma's attorney general on Thursday agreed to a six-month stay of execution for Warner, who was scheduled to die next week. (Read documents related to the stay here and here.)

Gattoni says Oklahoma's secrecy statute, passed in 2011, represented a serious legal obstacle. Without knowing what was in the drug cocktail or who made it, her clients couldn't file a constitutional claim that Oklahoma's method of execution had become cruel and unusual. So Gattoni went after the secrecy statute.

"We filed a civil action saying this secrecy statute is unconstitutional because it prohibits us from having access to the courts, meaning you can't raise an Eighth Amendment claim if you don't even know what they're using," Gattoni says.

In late March, Oklahoma County District Judge Patricia Parrish agreed, ruling Oklahoma's secrecy statute was unconstitutional. "I do not think this is even a close call," Parrish wrote. The problem for Lockett and Warner was that they only had a month left to live. And this is where Oklahoma's legal system got messy. Oklahoma's highest criminal court, the Court of Criminal Appeals, refused to grant Lockett and Warner a stay of execution. That meant the Oklahoma Supreme Court, which hears civil and constitutional matters, would not get the opportunity to hear the secrecy case. This so angered the Supreme Court it responded by doing something unprecedented.

"The Oklahoma Supreme Court itself for the first time in its history issued a stay of execution," says University of Oklahoma law professor Maria Kolar.

To say this was not a politically popular decision is an understatement. Oklahoma executes more prisoners per capita than any other state. Members of the state Legislature vowed to impeach every single Supreme Court justice that voted for the stay. Gov. Mary Fallin charged the court with exceeding its jurisdiction and indicated she would not be bound. The backlash was so intense that just two days later, the Oklahoma Supreme Court unanimously cleared the way for Lockett and Warner's execution.

"I have no idea what happened in those two days. It is a short period of time. It's certainly an unusually short period of time for a court to come to resolution on issues of this scope," Kolar says.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.