Crown lawyers acting for the United States knew before seizing Kim Dotcom's fortune and property that they were using an unlawful court order.
The High Court file has revealed Crown prosecutor Anne Toohey realised there was a paperwork problem on the morning of the January raid.
The Solicitor-General at the time, David Collins, was alerted to the error but told the mistake didn't alter the lawful nature of the order allowing the seizure of Dotcom's wealth.
The advice was wrong - Justice Judith Potter later ruled the restraining order "null and void" and having "no legal effect".
The result left Dotcom without the chance to have his day in court or the money to fund a fight against claims he was behind as international criminal conspiracy in copyright infringement.
The financial seizure was part of a multi-pronged attack after orders issued in US courts led to the arrest of Dotcom and three business colleagues.
The Crown Law office went to court with the orders to have them enforced here and told judges they were "without notice" - meaning Dotcom's team did not need to be warned. But newly obtained documents from the court file show Ms Toohey realised on the day of the raid that they were meant to give notice.
Crown Law criminal team leader Madeleine Laracy, in an affidavit to the court, said: "This issue had been overlooked prior to that point."
She said she talked about the realisation with Dr Collins and his deputy, Cameron Mander, and the decision was made to forge ahead with the seizure.
Ms Laracy said it was decided Crown Law would tell Dotcom's lawyers the restraining notice was only temporary until there was a court hearing.
She said US authorities then sent a second request to the Crown Law Office to have more of Dotcom's belongings seized.
Ms Toohey was on the verge of having a fresh hearing over the new restraining order, at which time the error over the original order would have been raised.
Ms Laracy said Mr Mander realised the error was more serious and ordered the court be alerted.
Ten days after the raid, the court was told and a court process was allowed to give Dotcom the chance to object.
Justice Potter upheld the restraining order although she said Dotcom could sue over Crown Law's mistake. Dotcom has been given $20,000 a month to live on.