An Ontario court judge has ruled that a retired police officer is biased and cannot serve as an expert prosecution witness in a criminal trial into the purging of government records in former premier Dalton McGuinty's office.

Former Ontario Provincial Police detective sergeant Robert Gagnon "conflated the roles of expert and investigator," Justice Timothy Lipson told a courtroom at Toronto's Old City Hall on Thursday in disqualifying him as an expert witness. "There is a realistic concern that he is unable to provide independent, impartial and unbiased evidence."

Mr. Gagnon, who retired from the OPP in 2009, was retained by his former employer in 2014 to conduct a forensic analysis of computer hard drives seized from Mr. McGuinty's office in connection with an investigation dubbed Project Hampden.

Story continues below advertisement

Ahead of election, Ontario's Liberals face reckoning in the courts

"It soon became apparent that Mr. Gagnon's original limited role as a computer forensic expert morphed into something much more as the police investigation into Project Hampden proceeded," Justice Lipson of the Ontario Court of Justice said in his decision.

David Livingston, Mr. McGuinty's former chief of staff, and his deputy, Laura Miller, are facing criminal breach of trust and mischief charges in connection with the destruction of e-mails and other government records related to the controversial cancellation of two gas-fired power plants prior to the 2011 provincial election. They have each pleaded not guilty. The charges stem from police accusations that Mr. Livingston hired a non-government IT expert – Ms. Miller's spouse, Peter Faist – to "wipe clean" computer hard drives in the premier's office just days before Mr. McGuinty left office in February, 2012.

The two are accused of compiling a list of senior Liberal staffers whose computer records were to be deleted, all of whom police allege were involved in discussions around the Liberals' costly decision to scrap the power-plant projects in Mississauga and Oakville, Ont. Mr. McGuinty is not under investigation and has co-operated with the probe.

Mr. Gagnon was the first witness to testify after the trial began last Friday. But defence lawyers sought to have him disqualified as an expert witness, citing what that they said was a significant role he played in the investigation.

Under questioning from Scott Hutchison, Ms. Miller's lawyer, Mr. Gagnon said he participated in numerous conference calls and strategy sessions, communicating regularly by e-mail with the OPP team working on the case. For example, Mr. Gagnon was asked for his input on questions that police should ask Mr. Faist, a key Crown witness. Mr. Gagnon watched police interview Mr. Faist from a separate room, but did not suggest additional questions.

Judge Lipson said the most concerning example of Mr. Gagnon's bias was his recommendation to OPP investigators that Mr. Livingston and Ms. Miller could also be charged with mischief in addition to breach of trust.

Story continues below advertisement

What Mr. Gagnon did stands in stark contrast to the behaviour expected of a police expert witness, who is to provide evidence that is independent and impartial, Judge Lipson said. The evidence in this case reveals there really was no separation between the work of Mr. Gagnon and the OPP investigators, the judge said.

Mr. Gagnon and the investigating officers "worked together toward the same goal – the successful prosecution of Mr. Livingston and Ms. Miller," Judge Lipson said.

As a result of the ruling, Mr. Gagnon will not be allowed to express an opinion on any of the evidence he analyzed, but he will still be allowed to testify on what he found.

Linda Jackson, a former chief administrative officer in the cabinet office, testified on Thursday that she never saw an oath of office signed by Mr. Livingston when he joined the premier's office. Under cross examination from Fredrick Schumann, Mr. Livingston's lawyer, Ms. Jackson acknowledged that it is customary for chiefs of staff in the premier's office to sign such oaths.

Ms. Jackson also testified that the government did not begin providing training for political staff in document retention until after Premier Kathleen Wynne was sworn into office in February, 2013 – amidst the controversy swirling around the cancelled power plants.

The trial resumes on Friday.