At a submission hearing, Maddigan told the court he was driving home to Christchurch on the Milford Rd travelling towards Te Anau at the time he was arrested.
Maddigan's written submissions states: "I believe the (p)rosecutor chose to hid this crucial evidence to convince the Judge (I) was equally as bad as the mosque shooter."
In his decision released today, Justice Nation states the judge did not deny him bail to pressure or induce him to plead guilty.
However, a "fundamental error" was made by the judge and duty solicitor.
"In Mr Maddigan's presence, the duty solicitor advised the Judge that Mr Maddigan was bailable as of right but could nevertheless be remanded in custody if there was just cause for his continued detention."
"Judge Farnan dealt with Maddigan on that basis."
However, he was bailable as of right, Justice Nation says, and could have had a bail condition imposed to ensure he complied with police directions to return to Christchurch.
He believed that if Maddigan had been granted bail, he would not have pleaded guilty.
"He would have wanted to defend the charge, albeit on a basis that was not likely to succeed."
Justice Nation says he had to decide whether there would be a miscarriage of justice if Mr Maddigan was to remain convicted and sentenced after only being wrongly remanded in custody when it is likely he had, and still has, no defence to the charge.
"By a narrow margin, I have decided there would be such a miscarriage.
Justice Nation quashed the charge and remanded Maddigan on bail to appear in the Christchurch District Court on May 27.
If Maddigan defends the charge, the trial will be held in Invercargill.