Iran's diplomatic abilities are seriously lacking, and without wishing to insult them, perhaps actions like these also show some lack of common sense and vision beyond whatever provokes such action on the ground.
Iran for a long time now has been isolated by the US, by Israel, the Saudis and their GCC allies. Europe also cut ties with them, and in the immediate neighbourhood, they have no friends at all. Almost every Muslim nation with any power is already against them due to the KSA's influence.
The only exception was Pakistan, the relations with Pakistan if not very friendly, were at least neutral. What could possibly possess them to keep shelling and other needless provocations? In rather silly ways too I might add, a few mortar stray shells at a time, achieving absolutely nothing besides annoying Pakistanis who are already under pressure from the US, from the GCC and from KSA + supporters to side with them against Iran.
Pakistan amazingly even remained neutral in the Yemen conflict. Iran's actions defy all logic in my opinion, they ought to reassess.