Public Trust is New Zealand's sole Crown-owned trustee company and has more than $35 billion under supervision.
It was concerned at Perpetual's request as it had never assumed trusteeship of a failed finance company.
It thought taking over the trusteeship would cost a significant amount of money - which would not be reimbursed because C+M has no assets.
After initially opposing the orders, Public Trust said it would abide by the court's decision but filed a counterclaim for Perpetual to pay the costs of Public Trust acting as trustee for C+M.
The matter was heard in June by Justice Mark Woolford, whose decision was released publicly today.
Justice Woolford decided Public Trust should be appointed to replace Perpetual, as the latter had an "irresolvable conflict of interest".
"Perpetual is obliged to give directions to the receivers it appointed who have filed a proceeding against it claiming a breach of contract and negligence. Self interest would suggest Perpetual should direct the receivers not to continue with the proceeding, while the interests of the investors, which Perpetual is supposed to protect, would suggest otherwise," the judge said.
One of the functions of Public Trust was a "of trustee of last resort", the judge said.
"Public Trust is therefore duty bound to accept appointment by the court," he said.
Turning to the costs of acting as trustee, Justice Woolford said an order for the retiring trustee to pay ongoing administration and maintenance costs on behalf of the replacement trustee was not consistent with any trustee duties that were conceived when the Trustee Act was drafted in 1956.
"I am of the view that an order that Perpetual indemnify Public Trust for all the costs associated with being security trustee of CMF cannot be support on a reading of [the relevant law]," he said.
Because of this, he dismissed Public Trust's counterclaim for costs.
As a result of this issue emerging, Justice Minister Judith Collins in May moved to change the law and Parliament passed an amendment which meant Public Trust would be indemnified for costs from an outgoing trustee.
However, this law change was not retrospective and did not apply to these proceedings.