Involvement of Iran should not be considered as a Shia-Sunni conflict.
Though Pakistani Government was/is always tried level best to have cordial relationship with Iran, but Iran was/is always doubting Pakistan's sincerity.
Obvious reasons:
1. Pakistan's relationship with SA and UAE.
2. Pakistan's relationship with US and NATO countries.
3. CPEC through Gwadar - direct competition with Chabahar.
Not only that, there were number of occasions where Iran openly stand against Pakistan. Recent Panjshir issue is one of the examples of Iranian out burst. Kulbhushan Sudhir Jadhav arrest in 2016 also revealed Iranian involvement in harbouring Indian terrorist cells and RAW agents on its soil. Similarly recent arrest of terrorist confirmed that suicide bomber who targeted the Chinese convoy in the vicinity of Gwadar came from Iran. Moreover, most of the terrorist activities including terrorist attack on Gwadar Luxury Hotel in 2019 was also carried out by the Iranian insurgents.
IMO, Pakistan and China need to force Iranian Government to stop covert insurgencies inside Pakistan, eradicate all terrorist camps located on their soil, arrest or eliminate any rough elements of insurgents (BLA, BLF, TTP, ISIS and ISKP elements) hiding inside Iran.
Even after these warnings, Iran continued these activities, then a strong collective offensive action be taken to root out all possible terrorist cells being operated from Iran.