If any debt shall be allowed against the estate of a decedent after the payment of any legacy or distributive share from which any tax has been deducted or upon which it has been paid by the person entitled to the legacy or distributive share, and that person is required to refund the amount of the debts, an equitable proportion of the tax shall, upon the order of the court, be paid to him or her by the executor, administrator, trustee or other person, if the tax has not been paid to the state of Michigan. When any amount of said tax shall have been paid erroneously to the state of Michigan by reason of the allowance of debts or otherwise, it shall be lawful for the state treasurer, upon satisfactory proof by the order or certificate of the proper court of the allowance of the debts or of the reversal, correction or alteration, in accordance with law, of the order fixing the tax, to draw his or her warrant upon the state treasury for the erroneous payment, to be refunded to the executor, administrator, trustee, person or persons entitled to receive it, and charge the warrant to the fund which receives credit from the payment of taxes under the provisions of this act. However, applications for the refunding of erroneous tax shall be made within 6 months from the allowance of the debts or the reversal, correction or alteration of the order.