Endean said that once further quality assurance was planned, “NOMS were very happy for the research to continue and did not exert any undue pressure on me to stop the research.”

Dr Callum Ross, an expert in sex offender treatment at Broadmoor Hospital who had just written a paper questioning the evidence for the efficacy of the progrmme, put in a freedom of information request for the research in 2012. The FOI was turned down on the basis that the report was about to be published — yet no research was published until 2017.

When it became clear in 2014 that no report was coming, Ross appealed to the Information Commissioner’s Office. The MoJ told the ICO that the research was still being quality-assured and would be published in due course, sending evidence of the concerns raised by NOMS and the Correctional Services Accreditation and Advice Panel (CSAAP). It did not, however, share the peer review from 2012, where experts had said the report could be published subject to changes.

After Hopkins emailed managers in July 2014 to say she was concerned that the response to the Information Commissioner and the department’s handling of the research was in breach of the Civil Service Code, her message was forwarded to Endean as head of the department.

In her reply to Hopkins’ managers, Endean said Hopkins should “think twice” about making the complaint because it would “expose” her. “Can you tell Kathryn that I would welcome her putting in a formal complaint that we have not followed the Civil Service Code? However, this would expose the poor quality of her work (I would need to be very clear why the work is way below what I would expect from a band A) and therefore she may want to think twice.”

She went on to say: “I am really getting to the point where I am going to insist that we start formal poor performance proceedings as this behaviour is not acceptable and we should not accommodate it. If we are failing the CSC then it is in this regard rather than anything else.”

Speaking at the tribunal, Endean said of the email: “It was a very intemperate email. I was very frustrated and I wish I hadn’t sent it.”

In summation, the MoJ’s barrister, Paul Skinner, said that Hopkins’ whistleblowing was not the motivation for decisions made by staff in the department.

Given that she was suffering from stress and ill mental health, Skinner said many of the MoJ’s decisions were motivated by wanting “to do what they could to get the claimant well” and that “there were real attempts to help [her]”.

Of Hopkins’ position that it would want to cover up the findings, Skinner said that the MoJ “wouldn’t want to be giving treatment to people that just doesn’t work”.

Commenting specifically on bullying allegations against Endean, Skinner said: “In my submission, it isn’t right to find that Miss Endean was an Iago figure motivated by the claimant’s whistleblowing” and that her motivation in asking for reiterations of the research was purely to get the most robust results.

Hopkins claims that Endean bullied her from 2012, when she first raised concerns about the report and the department’s delay in publishing it. Following a peer review, which recommended the study could be published subject to changes, Endean instructed Hopkins to do further work on the project which Hopkins considered unnecessary and motivated by a desire to minimise or change the results.

“I recall being shouted at because there’d been no shift in the results,” Hopkins told the court, but Endean said: “I have no recollection and doubt very much that I did that.”

Endean said the amount of quality assurance done on the report was rare but that it happened because the methodological approach was novel and because concerns had been raised about its robustness.

“She’s a very good analyst and she may well have been right,” Endean said. “I might’ve been asking stupid questions and I might’ve been making everyone’s life miserable by asking that it be checked and double-checked, but that’s what I felt I had to do. At no point was I trying to fix the results, I just wanted to be sure that we didn’t make a mistake.”

Endean repeatedly said she was only ever motivated by quality and was not acting in response to Hopkins’ whistleblowing or any vested interests. “I just wanted to make sure everything was right. It was my job to make sure we’d done a proper quality assurance,” she said. “I was not swayed by any motivation other than to quality-assure the work.”

Hopkins asked Endean about a meeting in January 2014 when she alleges bullying took place when Endean was talking to her about NOMS. She said: “Do you remember saying ‘wipe that smile off your face’?”

Endean denied it, saying: “I said please don’t smile at me or please don’t look at me that way.”

Another witness working for the MoJ at the time said they had seen Endean “shouting at other people” and being aggressive.

Endean admitted she got frustrated with Hopkins but said this was because she felt Hopkins was not taking her analytical concerns about the reliability of the study seriously.

The evidence concluded on Tuesday and a written judgment is expected later in the summer.