Jacob Holland once woke his mother in the middle of the night insisting his brother was stuck inside a sandwich bag in a wardrobe.
Mr Holland experienced these night terrors and sleepwalking episodes throughout his life, sometimes taking tins of food from the pantry to his bed, and once wandering out of his house.
On the night of November 9, 2014, Mr Holland was naked when he went into a neighbour's house in Coffs Harbour, put on a young girl's blue cardigan in the laundry, crawled on the floor, and assaulted a woman in her bedroom while yelling "arrghh".
He said he was dreaming about being in the mythical world of the computer game Skyrim when the woman's husband restrained him, only realising he was in trouble when he was taken to the police station and locked in a cell.
NSW District Court judge Phillip Mahony last week found the 21-year-old not guilty of aggravated assault occasioning actual bodily harm after a judge alone trial, finding prosecutors had not excluded the reasonable possibility he was sleepwalking, making his actions involuntary.
The court heard Mr Holland and his older brother drank beers and played Xbox games until about 10pm, before he went to bed naked.
About an hour after the older brother left the house, police called him and he found Mr Holland naked and hysterical in a cell, claiming police had told him he'd killed or hurt a child.
Alan Holland told court: "Jacob does these weird sleep things. He goes into a weird state and does crazy things and doesn't remember."
An officer who arrested Mr Holland at the house said he appeared drunk, but agreed the symptoms of "sleep drunkeness" - a sleepy confusion sleepwalkers suffer marked by disorientation, balance problems, slurred speech and mumbling - was similar to intoxication.
The Crown's expert Professor David Greenberg said Mr Holland's actions were more likely the result of intoxication, in part because sleepwalkers tend to do "repetitive and purposeless" things.
Professor Greenberg noted that Mr Holland, who had been treated for behavioural disorders as a child, had never been diagnosed with sleepwalking by a sleep physician or neurologist.
The medical expert called by Mr Holland's defence found that a low level of blood alcohol concentration would not account for his actions, but could have made the sleepwalking worse.
Both experts found Mr Holland did not suffer from a mental illness.
Judge Mahony found there was no motive for Mr Holland to target the woman, whom he'd never met, and noted there were known examples of people driving or using machinery while sleepwalking.
"I am therefore of the opinion that the Crown case has not satisfied, beyond reasonable doubt, the onus on it to disprove the reasonable possibility that the accused was sleepwalking at the time of the offending conduct.
"Therefore his conduct was not voluntary at the time of that offending."