If the taxes charged on any land or lot, or part thereof, are regularly paid, and the land or lot erroneously returned delinquent and sold for taxes, the sale of the land or lot shall be void and the money paid by the purchaser at such a void sale shall be returned to him or her by the officer having the money in charge, on the order of the county court that the land was erroneously returned delinquent and sold for taxes.