Mughals and ottomans failed because they were too busy fighting within themselves for power. Whereas European monarchy survived this far because they did a lot of political marriage and ended up becoming cousins
Too many darbars, too busy banging hareems, not enough investment in education, letting Hindus do all the bookkeeping and state running affairs because our mighty inbreds saw it beneath them. Hundreds of years later, you have one bunch of people so much more educated than others. That's their no1 failure if you ask me. That legacy is quite evident when one compares to the education of South Asian Muslims, which though improving, isn't very pretty yet. Especially compared to what other Asians have achieved
Yet nowadays, if one opens the history book about all the best achievements of the Ottomans, one finds remnants of a mysterious sticky white fluid, leftover by certain people who perhaps enjoyed reading it far too much.
I would say Mughals, along with being a lot wealthier, were slightly more technologically advanced than the Ottomans. Ottomans often outsourced their shipbuilding to Bengal (Chittagong), because the Bengal was literally the world's shipyard from 1200-1750AD. Everything from small merchant vessels to man-o-war type flagship vessels. Also, metallurgy was more advanced in Asia than anywhere back then. Our steelmaking furnaces channeled strong monsoon winds to produce very intense flames. So our cannons, muskets, even the bearings used on everything from wagon wheels to a ship's steering rudder, were MUCH stronger, and longer lasting.
However, neither Mughal nor Ottomans can be regarded as the extension of the Islamic Golden age. They were very powerful and wealthy, but they did not use their wealth in a wise way. They produced very little intellectual work (almost 0), unlike the true Islamic golden age, whose intellectual contribution was enormous, and acknowledged by virtually everyone. Both Mughals and Ottomans were interested in astronomy. But neither of them understood astronomy with the same level of mathematical vigor as the true Islamic golden age, as they did in Bagdad, Cordoba, etc. Neither did they contribute new knowledge, or keep pace with the very latest in developments around the rest of the world.
This is why we witnessed such an asymmetrical development of technology between East and West, which had contributed to the unfortunate situation the Muslim world currently finds itself in.
It's also why Dubai, Qatar, KSA, despite being fairly rich, cannot brag about any world-class universities or research output (measured in impact, not just volume of papers published in low-quality journals). Their academic performance, relative to overall living standard and wealth, is quite appalling. Whereas Singapore, with their NTU and NSU, can. So can China with their Tsinghua, created at a time they were even worse of than India and Pakistan