Evidence by a senior police officer about a judge helping stack up false charges to protect an undercover agent has clashed with details in a court file.
The details show testimony from the head of the police undercover programme pitted against a signed statement by a court manager.
The evidence was given in the "Red Devils" court hearing, in which charges against 21 people were dismissed after a High Court judge said police had "committed ... fraud on the courts".
Police were found to have manufactured a fake search warrant, created an invented signature of a court official to back it up then staged a false arrest of an undercover agent.
They then put an undercover agent through court with false charges - later claiming they did so with the blessing of Chief District Court Judge Russell Johnson.
Documents released by the High Court show testimony from police undercover programme boss Detective Senior Sergeant Warren Olsson in August about an earlier case said to show a precedent for colluding with a judge during an investigation.
Mr Olsson said an undercover officer from the 2002 Operation Kansas had a judge's blessing to go through the court process under a fake name on charges which were later dropped.
Mr Olsson said "the permission of a District Court judge" meant the agent went before the court under an assumed name "until after the operation was finished whereby the charges were withdrawn".
Mr Olsson said he had "a working knowledge" of Operation Kansas as head of the undercover programme and National Co-ordinator of Gang Intelligence.
But details released by the High Court in Wellington showed an alternative version of events.
A 2003 signed statement from then-Wanganui court manager Marcus Vettise stated Judge Mike Crosbie would not discuss the issue with the senior police officer who had sought a private meeting.
Mr Vettise said he escorted Detective Senior Sergeant Warren Smith to the judge's chambers. He said it became clear "the operation was at risk due to the operative's identity being revealed and that police were considering several options".
Mr Vettise said the senior detective spoke of police considering laying a charge against the undercover agent.
He said "I distinctly remember at that point the judge holding up his hand, motioning for Detective Smith to stop and saying words to the effect 'I don't want to know about any of this' or 'I don't want to know about that'."
He said the meeting ended at that point.
The details were released by Justice Forrest Miller who said there was a strong public interest in matters relating to the performance of the police and the courts.
Justice Miller said he accepted it might lead to criticism of individual police but "the police will have the opportunity to comment on it".
Police national media manager Grant Ogilvie said police would not comment because an appeal on the High Court decision had been made.
Officers involved in the Red Devils operation face possible disciplinary or criminal charges over their actions.
The operation was overseen by the Organised and Financial Crime Agency's Detective Inspector Grant Wormald, who also ran the operation into Kim Dotcom.
Mistakes in that operation have led to a police inquiry into illegal spying by the Government Communications Security Bureau.
Steve Rollo, lawyer for some of the men arrested in the operation, said the Red Devils case raised serious issues for police.
He said no judge was able to give police permission to "commit criminal offences".
"Quite how the police have arrived at a point where their leadership think it's appropriate to try and cosy up to judges behind closed doors in this fashion is beyond me.
"If that kind of thinking sets in across the organisation then we're all in deep trouble."