Causing disturbance in Makkah and Madinah are offence as Pakistanis that resides in Makkah/Madinah have no business getting involved in the politics that has nothing to do with Saudi Arabia or granted access visa to pay at Makkah and Madinah doesn’t invite disturbance whatsoever since Makkah and Madina are under the jurisdiction of Saudi Arabia which has nothing to do with Pakistan and its democratic elected governments.
To voice the grievances against Pakistani government for Pakistan related issues , Pakistan is right platform for that. Not Saudi Arabia that doesn’t have any jurisdiction over Pakistan.
Wrong platform in wrong nation at the wrong time with limited granted visa access that doesn’t allow you to cause disturbance invites stricter punishment and can be deemed as foreign threat. Saudi Arabia will deem whatever it is necessary to ensure the disturbance doesn’t happen again.
Religion aside;
Since you are justifying the motives, then religion aside, they are under the jurisdiction of Saudi Arabia and any sentence laid out by Saudi Arabia will be carried strictly as possible. Only Pakistanis those who are involved are responsible for their own deeds. And this doesn’t charter under the responsibility of Pakistan government. I hope Imran Khan is generous enough to pay the fines for his loyal supporters.