There is, of course, no law against insulting the Agong or any other prominent Malaysian. Criticism, often rightly, goes with such jobs and if VIPs wish to avoid criticism they should either comport themselves blamelessly or look for another job.
It is scandalous that a Malaysian should be punished under a law not in any way intended to avoid hurting the feelings of VIPs or allowing sycophants to pursue citizens in the hope of attracting VIP favour.
In the present instance it is surprising that the level of criticism is so low in view of the extraordinary decision to choose the unsupported Muyhiddin in the face of the known wish of most MPs to have Anwar Ibrahim as Prime Minister.
Of course the public have no means of knowing if the prosecution in question was mounted after a royal complaint or, more probably, by some minor sycophant hoping for favourable notice.