Actions we do while we are awake that do not require much thinking, including those of a sexual nature, are common for those who sleepwalk, Fernando says.
"The behaviours are automatic. Eating is common, walking, urinating in the corner of the room thinking it is a toilet, driving. It sounds bizarre but we don't actually require a lot of thinking when we are driving.
"Your eyes are open and you are still processing external information. When people are sleepwalking they don't fall on the stairs. They process the visual information and the behaviour is automatic. How often do you consciously think about walking? You don't."
The woman and the cycling man were suffering sleep disorders from the parasomnia group which include sleepwalking, sleep-eating and even driving while asleep.
The woman, specifically, was suffering from sexomnia.
The term was coined in 2003 in a research paper in the Canadian Journal Of Psychiatry which described the cases of 11 patients whose parasomnia behaviours were sexual and concluded it was a distinct type of the condition.
There's also the more serious cases.
The ones that end up in court.
Sexomnia reflects scientific research but comes with the risk it may be seized upon by malingerers as an excuse for criminal acts.
The courtroom defence is automatism, a legal term simply meaning action without conscious thought or intention.
It's cropping up more and more around the world, with five known cases dealt with by New Zealand courts. The most recent example was the acquittal earlier this year of 35-year-old Tristan Corey Scott.
He was found to have indecently assaulted two teenage girls while they slept in their beds but the judge dismissed the charges after finding that intent could not be proven because the man was effectively sleepwalking.
In dismissing indecent assault charges against Scott, the judge found the offences were committed while Scott was in a state of "automatism caused by excessive alcohol consumption".
Scott has an earlier conviction for similar offending committed before parasomnia was diagnosed.
In 2013, a man was acquitted of indecently assaulting a girl, aged between 12 and 16, after claiming he must have been sleepwalking. He had walked into her bedroom while she was sleeping.
The man said he had no memory of the event and must have been sleepwalking as he woke only when the girl's father started punching him.
In another case, a woman awoke on numerous occasions to find her husband having sex with her during the seven years they were married.
Initially she accepted his sexomnia explanation but came to doubt it, particularly after he admitted being awake after one of the incidents.
During one of the attacks, she tried to trick him by asking the time. He looked over at a clock near the bed and told her, a 2017 Court of Appeal Decision states.
The man was found guilty on three charges, including one of rape. But he was found not guilty on some other charges, which the Appeal Court said suggests the jury accepted it was reasonably possible he was asleep and his conduct was therefore not deliberate.
In 2008, a Whangarei man was found guilty of indecently assaulting a girl aged between 12 and 16 despite evidence of a history of parasomnia episodes.
He claimed he had no memory of the incident and must have been asleep. He was sentenced to nine months' home detention.
And in 2006, a man was found not guilty of a sexual offence involving a young girl on evidence that he was asleep at the time.
The difficulty for the courts lies in determining whether the person was in a sleep-state.
A clue is looking at whether they had a long history of other forms of parasomnia. Sexomnia is regarded as the last of those types of conditions to emerge.
Academic researchers have noted that this has important legal implications in that a first-time alleged sexomnia episode that results in a legal sexual assault charge should be viewed with great skepticism, and raises the strong suspicion of a "sexomnia excuse".
Most cases of sleep sex recorded in psychiatry literature involve men.
Women suffering from parasomnias tend to be less violent but more vocal, Fernando says.
"They talk a lot and they scream a lot. So they don't usually get into trouble. Most of the time, men tend to be quiet but violent.
"It can be quite dramatic. It can be rape really, or assault." Fernando, who lecturers in psychological medicine at Auckland University and practises privately, gave evidence in the Scott case and the husband and wife case.
He told the Herald on Sunday he can never categorically state whether someone was asleep at the time a crime was committed.
Even the example of the husband responding when asked the time is equivocal, says Fernando, because sleep can be quite superficial for people with parasomnia and being asked a question could bring them to wakefulness.
There are many documented cases of parasomnia where the person is truly asleep when "they do a lot of crazy behaviours", Fernando says.
"Sex is just one of the many automatic behaviours.
"The behaviours are often mechanical and don't involve a lot of high-level thinking like discussing the politics of Trump versus Jacinda [Ardern], because that involves a different part of the brain."
Sexomnia is rare and examples that end up in court are rarer still. Fernando says Auckland University is about to begin a project to identify all Australasian cases but there is thought to have been only a few in New Zealand.
The most common sleep problem people come to him with is insomnia. Parasomnias, such as very vivid nightmares, problem sleepwalkers, people who kick in their sleep, and extreme teeth-grinding, are also common.
Most of the time the condition can be treated through medication, lifestyle changes, or both. Alcohol, sleep deprivation and stress are considered common triggers.
The cases in the 2003 Canadian journal ranged from masturbation to sexual assault resulting in prosecution. In each criminal case the defendant was acquitted.
The report said steady progress has been made in identifying "the complexity of nocturnal behaviour from a time when somnambulism (sleepwalking) was the only parasomnia known to medicine".
It noted that subconscious sexual intent derived from the sex drive was "deeply-rooted in the human psyche ... and for this reason, we cannot exclude the possibility of genuine parasomnia that features such underlying intent".
But it also warned about fakes, and said the incidence of possible malingering may be higher than for other parasomnias.
There have been a number of cases in England where a defence of sexomnia was successfully run and a couple in New Zealand, says Professor Warren Brookbanks, an expert on psychiatry and the law.