When by reason of nonconformity to any law, or by any omission, informality, or irregularity, or for any other cause, any tax heretofore or hereafter levied and assessed against any person, company, association, or corporation by the director of revenue is invalid or is adjudged illegal, the director may assess and levy a tax against such person, company, association, or corporation for the year or years for which such tax is invalid or illegal, or when necessary may assess and certify the same to the proper county officers, who shall levy such tax as by law in such cases made and provided, with the same force and effect as though done at the proper time and under any valid law, whether in force at the time of said levy and assessment or thereafter enacted.