I would point out that dealing with a medical trust is a nightmare as there is a disconnect between what a court orders, as they have control over the trust formation and other legislation such as tax. Courts simply ignore other legislation outside of their consideration, their sole focus is on the beneficiary of the trust.
In this case a divorce had taken place and was a court settlement not a private one as children were involved, normally couples act as trustees but when you divorce that trust must become a court appointed trust, courts regularly appoint themselves legal guardians and just as often remove themselves as guardians. Simply put a court can remove you at a bang of a gavel from being a child's parent and as quickly reinstate you, basically they grant you access to your own children without you having any rights over the child until a divorce is complete and you agree the terms with a court on parental responsibility and satisfy the court that you are carrying them out.
I suspect that this will be one of those cases, a court telling you are not the legal guardian and you acting at the courts direction , only to find out later that in the eye's of another piece of law you were still the parent all along for the purposes of that other law. If you are told by a judge you are not longer a child's parent who do you believe ?
Judges are literally a law unto themselves.