6. An action shall lie against any resident magistrate,[F1 lay magistrate] or clerk of petty sessions in respect of any act or omission of his—
(a)in the purported exercise of his duty—
(i)as[F1 a resident magistrate or a lay magistrate]; or
(ii)as such a clerk exercising, by virtue of any statutory provision, any function of a magistrates' court; but
(b)with respect to a matter which is not within his jurisdiction,
if, but only if, it is proved that he acted in bad faith.