A leading authority on the phenomenon of parents leaving kids in hot cars testified Monday that, on June 18, 2014, Justin Ross Harris was operating on little sleep and straying from routine — factors that likely contributed to the former Home Depot web developer forgetting that his toddler, Cooper, was still inside his SUV.

David Diamond, who studies the brain and memory, was to have been the defense’s expert witness in Harris’ 2016 murder trial. He wasn’t called after Judge Mary Staley Clark ruled the state should have access to his notes from pre-trial meetings with Harris and his lawyers.

That was was just one of the judge’s rulings which made it impossible for Harris to get a fair trial, according to the defense. A virtual hearing on Harris’ motion for a new trial began Monday, with Staley Clark presiding. The defendant, now 40, appeared via Zoom from Macon State Prison, where he is serving a life sentence plus 32 years.

“We were extremely, extremely concerned about the state getting these (notes),” defense lawyer Maddox Kilgore, lead counsel in the 2016 trial, testified. Attorney Mitch Durham now represents Harris. “My recollection is I essentially begged the court not to release these.”

Diamond, preceding Kilgore on the stand, testified that, on the morning Cooper died, Harris was stressed about a project for work that was behind schedule. He went to bed at 1 a.m., later than usual, and was awakened around 5 a.m. by 22-month-old Cooper.

EXPLORE: Complete coverage of the Justin Ross Harris case

“His routine, pretty much every day, he would get up with Cooper, have breakfast with Cooper, then prepare him for the day” and take him to daycare, Diamond said.

On this day, Harris had to be at work early for a meeting. He hurried out of the house, skipping his morning shave. He planned to drop Cooper off, hit the drive-through at Chick-fil-A and report to work, Diamond said.

While on the road Harris received a message the meeting had been delayed, Diamond said. So he decided to have breakfast with Cooper inside the restaurant, another break from routine.

“That is an essential factor,” said Diamond, referring to other cases he’s studied where kids were left behind in locked cars. “What’s essential is for the hippocampus to be reactivated to remind the parent the child is in the car.

But that didn’t happen, he said. There were no reminders, nothing on the front seat that he would’ve seen, nor any sounds from Cooper, who was strapped in a rear-facing car seat.

Kilgore testified he was concerned Diamond’s notes would be taken out of context to “put words in Ross Harris’s mouth.”

“We would have called Dr. Diamond to testify in this case if we hadn’t had to turn those notes over,” he said. Diamond would’ve discussed how the Harris case was consistent with others where the child’s death was precipitated by memory failure, Kilgore said.

The Marietta attorney also testified about his frustration with the judge preventing the defense from challenging misleading allegations leveled by Cobb County police investigators at Harris’ probable cause hearing.

“There was no question at all, ever, in our minds, that we would not be allowed to question a law enforcement officer who had given false testimony under oath in this very case,” Kilgore said.

He said the defense was hamstrung from the beginning by a “mountain and cavalcade of bad character evidence” against Harris revealing his sexual infidelities that was irrelevant to the question of whether he intentionally killed his son.

Judge Staley Clark has reserved three days for the hearing. She’s unlikely to grant the new trial ― judges rarely do, said Marietta attorney Ashleigh Merchant.

“This is an opportunity for the lawyers to put up evidence,” she said. “Whatever happens, it’s going to be appealed.”