Any person who, being employed in the public service, or as an officer of any court or tribunal, perversely and without lawful excuse omits or refuses to do any act which it is his or her duty to do by virtue of his or her employment is guilty of a misdemeanour, and is liable to imprisonment for 2 years, and to be fined at the discretion of the court.