Anything done by a person in the person’s purported capacity as an appointed justice of the peace or appointed commissioner for declarations is not invalid only because, at the time the thing was done—
(a) the person was not validly appointed under section 15 ; or
(b) the person’s appointment—(i) had lapsed under section 21 ; or(ii) had ended as mentioned in section 22A ; or(iii) was suspended under section 31C .