If a tax title is for any reason adjudged invalid by a court of competent jurisdiction, the clerk, upon request, shall issue a certificate to that effect. The treasurer of the city or town where the land affected by such a tax title is situated, upon receipt of a release by the holder of said title of all the interest which he may have under his tax deed, together with such a certificate, shall refund to such holder the amount paid therefor but not exceeding the amount received by the city or town, with interest at the rate of six per cent per annum for a period of not exceeding two years from the date of the tax deed. The treasurer shall forthwith record said release in the proper registry of deeds, and thereupon, if the said invalidity was caused by an error, omission or informality in the assessment of the tax, the treasurer shall notify the board by which the tax or assessment was laid, which shall forthwith reassess it as provided in section seventy-seven of chapter fifty-nine; and if such invalidity was caused by an error, omission, or informality in the proceedings of the collector, the treasurer shall thereupon notify the collector who shall forthwith collect the unpaid tax or assessment in conformity to law.
Mass. Gen. Laws ch. 60, § 84A