Correct me if I am wrong: The Saudis were not even invited but still went to the funeral? Either way, the great anger the Saudis had when the Aramco facility was bombed (Iran or Israeli false flag?) came down. I recall the Pakistani military high command then had a Corps Commanders urgent meeting where Pakistan had to respond to help Saudi Arabia. And I also think the official govt of Iran had denied the attack but the IIRC had owned the attack--something which the Iranians need to work on! There can't be multiple centers of power in a nation like in Iran's geopolitics.
Back then, the Pakistanis stressed upon Iran to be careful about Saudi Arabia because Pakistan was treaty-bound to help Saudi Arabia. And I believe that message was understood by Iran. Both Turkey and Pakistan have been very active in preventing this war to become an Iran-Arab war, which would be Israel's dream come true.
And looking at the Saudi delegation in this funeral, I believe Pakistan's hard work has worked!