5. No action shall lie against any resident magistrate,[F2 lay magistrate] or clerk of petty sessions in respect of any act or omission of his—
(a)in the execution of his duty—
(i)as[F2 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; and
(b)with respect to any matter within his jurisdiction.]