The Security Intelligence Service was calling the LynnMall knife attacker a terrorist for years, at the same time as courts were hearing he was a high, medium or even low-risk threat.
Ahamed Aathill Samsudeen stabbed shoppers in an Auckland supermarket last September, injuring seven people before being shot dead by police who had had him under surveillance 24/7 for 53 days.
Authorities are poised to report back on a joint investigation into the case.
At the same time, Muslim leaders say the lack of state help, contrasted with a surfeit of surveillance and warnings, show that security fears won out over any attempt to deal with Samsudeen's diagnosed mental health problems.
The SIS began describing the 32-year-old as a would-be Islamic martyr and terrorist attacker in early 2017, and an adherent of ideological violence from 2015.
This is repeated across more than a dozen security agency assessments up to September 2021.
Criminologist Dr Clarke Jones, who prepared a rehabilitation plan for Samsudeen in 2018 that was not enacted, said this showed bias common to Western security agencies.
"They've got this one frame of him, and that was never going to change," Dr Jones said.
"And if we know about this information in the very early stages, why isn't initial support offered?"
The Ministry of Justice was copied into the SIS warnings, but said it did not pass such reports on to judges.
"The separation of powers means that while the ministry works with the judiciary to deliver court services, it doesn't supply information to the judiciary on specific cases," the ministry told RNZ.
"That information - evidence and submissions - comes to the judge through the parties to the proceeding.
"Further, the report which has been partially released in this case notes that the intelligence may not be used evidentially."
Samsudeen's brother in Dubai wrote to authorities in 2017 pleading with them to give him bail, a five-year travel ban and psychiatric counselling.
Instead, he was held in prison on remand for a year, got out briefly, then was locked up again on remand for another three years.
The security documents are heavily redacted, but do not talk about his mental health in the readable bits.
The Federation of Islamic Associations' spokesperson Abdur Razzaq said FIANZ's inquiries showed that authorities did nothing to try to turn Samsudeen around in his first year in prison.
An SIS report in 2018 described him as facing terrorism-related charges, when that was not the case, Razzaq said.
This was "a deliberate attempt to misguide and contradicts the court ruling. This was indicative of the Islamophobia in public sector agencies, including the NZSIS, as noted by the Royal Commission.
"This is one of many examples in which the Prime Minister may have been misinformed," he said.
The Samsudeen threat assessments from the joint Police-SIS-Corrections operation were issued in a period when police intelligence gathering as a whole was fractured and weak, and SIS data-gathering was slowly improving off a very low point in 2014.
All three agencies declined to comment while they wait for the official investigation report to come out in May.
Eleven government agencies were copied into the SIS reports.
It began investigating Samsudeen in September 2015 over his Facebook posts about violence and Islamic State. These were eventually ruled R18, but not objectionable.
The SIS and the Combined Threat Assessment Group (CTAG) did six threat assessments in 2018 alone, revolving around Samsudeen's release on bail that June.
He had twice earlier been denied bail, over "a risk of violent offending".
Weeks after he got bail, the SIS said Samsudeen was almost certainly mobilising towards an act of violence in New Zealand. The agency had repeatedly warned of this if he was blocked from travelling abroad to engage in jihad - and he was blocked.
CTAG at the same time was saying Samsudeen was a "medium" risk, with "the capability to carry out a low sophistication attack using bladed or other improvised weapons and/or possibly a vehicle".
At his sentencing in September 2018 on reduced charges, the Probation Service assessed him as "posing a medium likelihood of reoffending, but with a low risk of harm", and a forensic psychiatrist as "a low risk of serious reoffending", but the judge disagreed.
A year earlier, after Samsudeen's arrest, his brother had written to authorities that "dreadful and painful incidents" in Sri Lanka growing up had led to Samsudeen's mental instability, and that isolated as a refugee in New Zealand, he got ensnared in controversial material online.
"Anybody suffering from a disturbed mindset deserves another chance to remake their future," the brother wrote.
Though the Crown and defence agreed in September 2018 to a sentence of one year's supervision, because Samsudeen by then faced new charges, he did not get out.
He would spend the next three years on remand, including one year in a maximum-security wing that also housed the Christchurch mosque attacker, a unit strongly criticised by the Ombudsman for having significant safety issues and little opportunity for rehabilitation.
Eventually, when he was sentenced over two objectionable violent religious hymns, and released on supervision in July 2021, a judge ordered him to undergo rehabilitation, noting an assessment that he had the means and motivation to commit violent acts in the community and "despite not having violently offended to date, as posing a very high risk of harm to others".
Police kept him under round-the-clock surveillance for the next 53 days, up to the day of the attack at LynnMall, where he went regularly to shop.