Whenever any such official bond shall not contain the substantial matter or condition or conditions required by law, or there shall be any defect in the approval or filing thereof, such bond shall not be void so as to discharge such officer and his or her sureties, but they shall be bound to the state, or party interested, and the state or such party may, by action instituted in any court of competent jurisdiction, suggest the defect of such bond or such approval or filing, and recover his or her proper and equitable demand or damages from such officer, and the person or persons, who intended to become, and were included in such bond as sureties.