Erin Mullavey, 42, was stabbed in her head, neck and body late at night on Easter Sunday 2023 in western Sydney.
Her killer Morten Birkegaard Jensen was found not criminally responsible for his actions on Tuesday after the NSW Supreme Court found he had schizophrenia at the time.
Justice Phillip Boulten said the 35-year-old had been experiencing significant delusional thinking.
"He was suffering from very particular delusions that must have made his understanding of events quite frightening and distorted," the judge wrote in his decision.
Jensen believed Ms Mullavey had placed an evil spell on him.
He felt great pressure to act, believing that evil would triumph if he did not kill her, the judge noted.
"He believed that the deceased's destiny was death - which was necessary for him to commit in order for him to save ... the whole world," Justice Boulton wrote.
"To him, killing the deceased was both logical and necessary."
The 35-year-old's mental state was significantly impaired to the point where he did not know what he was doing was wrong, the judge said.
Jensen had been childhood friends with Ms Mullavey's husband Nicholas Gilbert.
Hours before he killed Ms Mullavey, Jensen was seen paranoid and agitated at a friend's place, speaking about witchcraft and a Nigerian witch doctor.
Threatening texts sent by either Mr Gilbert or his wife about allegedly stolen designer handbags to a woman Jensen knew angered him, Justice Boulton said.
However, this did not prove he had a rational motive for murder, the judge found, because his thinking was also affected by volatile delusions.
Jensen tried to disguise his role in the killing, including by lying to police, changing clothes and trying to blame Mr Gilbert.
He was arrested more than three months after Ms Mullavey's death.
"He knew that what he was doing was illegal," the judge said.
"But he felt compelled to act in that way because it was the morally correct way to act in response to the thoughts that drove his thinking."
Lifeline 13 11 14
beyondblue 1300 22 4636