An Ontario judge made legal errors in designating a man who withheld his HIV status from women he had sex with as a dangerous offender, but those mistakes did not affect the outcome of the case, the province's highest court said in upholding the decision Monday.

Daniel Gracie, 43, had a lengthy criminal record by the time he pleaded guilty to two counts of aggravated sexual assault involving two London, Ont., women with whom he had unprotected sexual activity, infecting them with the HIV virus.

In a 2010 incident, he sexually assaulted a woman with whom he was staying while she was sleeping, according to court documents. She discovered a year later that she had contracted HIV.

The second complainant was in an on-and-off relationship with Gracie and had unprotected sex with him on multiple occasions while they were dating in 2010 and 2011, after he assured her he had no sexually transmitted diseases, documents say. She also tested positive for HIV later.

Gracie had been told by doctors and his probation officer about the risks of having unprotected sex and his legal obligation to disclose his HIV status to any potential partners, documents say.

A judge deemed Gracie a dangerous offender, a legal designation reserved for those repeatedly convicted of violent or sexual crimes, and sentenced him to remain behind bars indefinitely.

Gracie appealed the dangerous offender label and the indeterminate sentence, arguing the judge didn't properly conduct a prospective risk assessment and failed to take into account his Indigenous background.

In a unanimous decision released Monday, the Court of Appeal for Ontario said that while the judge didn't conduct the risk assessment until the penalty stage, rather than doing so before declaring Gracie a dangerous offender, "there is no reasonable possibility that the verdict would have been any different."

The evidence overwhelmingly supported a finding that Gracie could not be controlled in the community, the appeal court said, noting assessments found him to pose a moderate to high risk of violent or sexual recidivism.

Gracie was also diagnosed with antisocial personality disorder and "significant psychopathic traits," which suggest he would be less responsive to treatment, the court said.

While previously behind bars, Gracie showed no signs of insight into his crimes or willingness to take part in corrective programming, it added.

"While there were signs of optimism because of his conduct at the Elgin Middlesex Detention Centre, the sentencing judge determined that this evidence amounted only to a possibility of eventual control in the community, not a reasonable expectation of such control," it wrote.

The appeal court further found that though the judge did not reference a report meant to help take into account Gracie's Indigenous background in his sentencing, those factors would also not have affected the outcome.

Gracie's biological mother was of Mi'kmaq heritage and a member of the Millbrook First Nations in Nova Scotia, but he was adopted as an infant by a "loving and supportive" non-Indigenous family that moved to Toronto shortly afterwards, the court said.

As a child, he was exposed to some Indigenous practices, such a smudging ceremonies, through a non-Indigenous uncle, it said.

"His life of crime began in his teenage years and he did not meet members of his biological family until much later in life, after he committed the predicate offences," the appeal court wrote.

The culturally specific recommendations in the pre-sentencing report did not address most of Gracie's risk factors, the appeal panel said.

"The risk of sexual and violent recidivism was the product of his serious personality disorder, his substance use disorder, his poor treatment and supervision history, and the dim prognosis for meaningful change," it said.

"The only recommendation in the Gladue report of any relevance to addressing these risks was the suggestion that he attend a healing lodge offering traditional and cultural teachings to address a wide variety of concerns, including alcohol and drug addictions."

Gracie had previously been convicted of sexual assault causing bodily harm for the violent rape of a sex worker, for which he was sentenced to five years in prison, the documents say.

While serving that sentence, he was charged and convicted of counselling the murder of the police officer who investigated the sexual assault, they say. He received another five-year sentence for that offence.

He was convicted of further offences after his release and was on probation for those crimes when he committed the sexual assaults at the heart of the appeal.