If any clerk fails to produce the trustee's receipt, when called on by the judge of the court of general sessions or the county mayor, or fails to produce the receipts of the commissioner of revenue and of the state treasurer, when called on by the county mayor, or by the district attorney general or attorney general and reporter; or if the receipt produced shows, from its date or otherwise, that the clerk has not complied with the requirements of the law, the court shall dismiss such clerk from office and appoint another in such clerk's stead, to hold the office until such clerk's successor is elected.