OAKLAND — Just before Judge James Cramer tossed out a plea deal blasted by some families of the 36 people killed in the Ghost Ship warehouse fire as too lenient, he warned them there’s now a chance the two men held responsible for the conflagration could walk out of jail scot-free.

“I do not know by rejecting this plea, I do not know if it will do these victims any good,” Cramer said last Friday about those who implored him not to accept an agreement that would have seen both defendants walk out in fewer than five years with time already served.

How a jury would rule is a “big unknown,” Cramer said, noting that the families should not presume a jury trial would result in a harsher punishment for Ghost Ship defendants Derick Alemna and Max Harris.

Cramer said he understood that each family member is suffering immeasurably from the deaths of their loved ones, but “a trial won’t solve that. It won’t.”

The judge said he decided to reject the deal because of Almena’s lack of remorse in his statements.

Despite his comments, many in the courtroom gasped, wept and looked around in shock when they realized what happened.

Chris Allen, the brother of Amanda Allen Kershaw, one of the victims who perished in the deadly Dec. 2, 2016 fire, said “Wow!” Karen Frieholtz, the aunt of Michela Gregory, quickly covered her mouth with her hand to stifle the sounds of her sobbing.

It was the culmination of an emotional two-day sentencing hearing, where a total of 36 statements were read out loud either by family members inside the courtroom or into the record by attorneys. At times during the proceedings, nearly everyone inside the Rene C. Davidson courtroom wiped away tears.

Allen said neither he nor the others felt there was any realistic hope that the outcome could be anything other than the judge accepting negotiated sentences of nine years for Almena and six years for Harris after they pleaded not guilty to 36 counts of involuntary manslaughter.

Even though the families met with prosecutors early Friday to make it clear they weren’t happy about the plea deal and were later told the judge might consider rejecting it, they didn’t believe that was likely.

So when the judge actually did so, many were stunned.

“We weren’t completely expecting that outcome. It just shocked everyone,” he said. “We want to see appropriate justice. If the trial is a way to get to that, that’s what we want,” Allen said.

Michael Cardoza, a well-known defense attorney and former prosecutor, said he cannot remember the last time a plea deal was rejected.

“It’s very, very unusual and caught everyone by surprise,” he told this news organization Monday.

Cardoza speculated that a “Judge Persky effect” may have contributed to the ruling. Santa Clara County Superior Judge Aaron Persky was recalled in November for issuing what many considered a lenient sentence against former Stanford University athlete Brock Turner, who sexually assaulted an unconscious woman near a fraternity on campus.

“That’s weighing a lot on judges’ minds,” he said.

As for why the district attorney’s office may have agreed to a seemingly light plea deal, Cardoza said prosecutors likely had some doubts that they’d be able to prove the charges “beyond a reasonable doubt.”

Laurie Levenson, an expert in criminal law at Loyola Law School in Los Angeles, agreed that if prosecutors had a “dead-bang” case, they wouldn’t need a plea deal.

Similarly, the defense also realized that 36 counts of involuntary manslaughter “will get you a long, long sentence” if a jury convicts, Cardoza said.

“Neither side was tremendously happy, which means it was a good plea bargain,” he said.

Cardoza pointed out there are a lot of unanswered questions, particularly why the owners were never charged, or the city of Oakland wasn’t held responsible.

District Attorney Nancy O’Malley has told this news organization that prosecutors could not “pin that” responsibility on the warehouse owner, the Chor Ng family. But she also said prosecutors have not given up the possibility, if some new evidence comes to light.

“Thats why you put it to the jury, to the citizens … and let the chips fall where they may,” Cardoza said.

For the families of fire victims, Judge Cramer’s action was more about doing the right thing than legal strategy

Sami Long Kopelman, mother of 34-year-old victim Edmond Lapine, said the plea rejection was a “step in the right direction.”

“Honestly I didn’t think it would happen,” Kopelman said. “I felt as though I wasn’t going to let my son die easily without a good fight, without an argument.”

At least now there’s an opportunity for that argument, she said.

Mike Madden, father of fire victim Griffin Madden, said in an email that he respected and appreciated that the judge seems to have listened to the families, the public and even the press.

Although he wasn’t as opposed to the plea agreement as some of the others, he said he thought the two men should have gotten more time than agreed to.

“These are two abhorrent bad actors whose behavior and actions were consistently enabled by the city of Oakland for years, including the police and fire departments, building inspection and up to the mayor’s office,” Madden said.

He said the primary focus should remain on the city of Oakland “for its incompetence and complete lack of accountability, that resulted in the deaths of 36 innocent people.”

Almena and Harris are expected back in court on Friday for the potential next steps.