Torchlight took 19 months to fully repay the advance and in May last year, Wilaci issued a A$33.62 million demand to the fund, about A$28 million ($30 million) of which was accrued late payment fees.
Wilaci appointed receivers the following month, in June last year.
Torchlight sought a declaration in the High Court at Auckland that the demand was unenforceable while Wilaci wanted judgment for sum involved.
In a decision released on Monday, Justice Matthew Muir said he considered the late payment fee so exceeded the loss likely to be caused that it "qualifies as extravagant" and was an unenforceable penalty.
The judge said where the sum sought to be recovered was many multiples of what he considered to be recoverable damages, a finding of extravagance was inevitable.
Justice Muir, however, said Torchlight and its general partner were to pay a loan fee of A$5 million, interest on outstanding sums, and receivers costs of $1.8 million. The interest involved is about $2.8 million, according to a lawyer involved in the case.