(1)An action lies against a justice of the peace in respect of what he does or omits to do—
(a)in the purported execution of his duty as a justice of the peace, but
(b)in relation to a matter not within his jurisdiction,
if, but only if, it is proved that he acted in bad faith.
(2)An action lies against a justices' clerk or an assistant clerk in respect of what he does or omits to do—
(a)in the purported execution of his duty as a justices' clerk or assistant clerk exercising, by virtue of an enactment, a function of a single justice of the peace, but
(b)in relation to a matter not within his jurisdiction,
if, but only if, it is proved that he acted in bad faith.