What needs to happen is for Iran and Turkey to keep their differences apart and work on the commonalities, which are plenty.
As many Muslim leaders have explained. when kuffar attack Muslims, they don't care who is Sunni, who is Shia and who is whatever other variety of whatever sect or other group that is accused of being deviant by stooge/pliant regimes of the West installed in the Middle East and around the world.
At one stage, Pakistan needs to be roped in.
Then, the three countries together would host about 360 million people, or more.
1. Under a mutual defence treaty, where an attack on one country by any country or group or entity is an attack on all countries within the pact, all three countries can first and foremost enjoy peace, stability and security.
With peace, stability, security, justice, transparency and accountability, these countries can pursue joint projects in various spheres and of course, provide 'nuclear umbrella' - any entity that threatens or attacks a country under the TIP (Turkey, Iran, Pakistan) 'nuclear umbrella' would get nuked in return.
Sanctions would not work.
There is a critical mass (of population, talent, market, landmass, resources, location, military might and most importantly, contiguous landmass, which makes it all that much easier). All three countries also host the highest numbers of Caucasoids out of all Muslim majority countries, not a surprise that these 3 countries are the strongest militarily and that Iran and Turkey are the most independent countries out of the 57 Muslim majority OIC members.
If the Al Saud/MBZ regime threatens Pakistan again, Pakistan should immediately send three army corps to Qatar.
Turkey should send three army corps equivalent troops to Qatar, too and the three TIP (Turkey, Iran, Pakistan) countries can conduct joint naval, aerial and (ballistic/other) missile exercises in the Arabian Sea, Persian Gulf, Gulf of Oman, the Eastern Mediterranean regions simultaneously to send a message loud and clear. Iran need not send any army corp to Qatar because the entire Gulf is just next door.
Those dictatorial regimes know very well that, lacking popular support, they won't last a fight against any semi-competent adversary.
As most opportunistic appointees in the armed forces will desert at the first opportunity and the oppressed public will topple the kingdoms when an opportunity arises.
The three contiguous Muslim majority countries of TIP (Turkey, Iran, Pakistan) can ensure that, by signing a mutual defence treaty, and providing a 'nuclear umbrella' to allied countries (perhaps, Qatar and Azerbaijan would like to be inaugural members of this club) no superpower from outside the region will dare to intervene.
The most pressing issue for the entire Muslim world is lack of a mutual defence treaty, and along with it, 'nuclear umbrella', meaning that any place on the planet can be nuked at a 'moment's notice', repeatedly, with thermonuclear devices.
As simple as that.
Once this issue is settled, the bulk of the problems can be sorted out one by one, Insha Allah.