Alesco then went to the High Court in 2011 over the issue, which involved around $8.6 million of tax, penalties and interest.
The IRD's position was upheld by Justice Paul Heath and Alesco then took the case to the Court of Appeal.
This appeal was dismissed this morning.
According to financial services firm Ernst & Young, Alesco is "one of 16 taxpayers who challenged the IRD's decision to treat the financial arrangements as tax avoidance".
"The IRD says the total amount in dispute is more than $300 million," Ernst & Young said.
Ernst & Young senior tax partner Jo Doolan said this morning's decision was an "alarming result".
"Even where taxpayers have real businesses behind what they are doing, the Commissioner can still rewrite the tax outcomes, often years after the transaction is finished," Doolan said.
"This is a worrying. It reinforces the feeling of many inbound investing corporates that the NZ tax environment is too uncertain. It may discourage them from continuing to do business here," she said.
University of Auckland Business School senior lecturer in tax, Mark Keating, said this morning that the decision was a "complete slam dunk" for the IRD.
"Not much joy for taxpayers here," he said.