Its very hard for Pakistan to go bankrupt, despite best of our efforts. Here's why:
You are right that opinion on street is that a divine intervention is keeping Pakistan afloat when countries like Argentina, Lebanon, Ecuador & Mexico went bankrupt. Greece was technically went bankrupt in 2010.
However truth is the foreign remittances from overseas Pakistanis are keeping the Pakistan afloat even when country was facing its worst fiscal enemy, Ishaq Dar. There is no other country whose foreign remittances are as high as her total exports. In this way , Pakistan's biggest single export is her labor working overseas.
I remember reading in news papers during 1990's that only 3 weeks (or similar period) of foreign reserves are left & country is in trouble. But we never came face to face to that trouble. Because even though SBP's foreign reserves were minuscule, overseas Pakistani kept pouring in dollars every month, which kept helped the country to meet its dollars needs without the Pakistan ending up like Mexico, Argentina or Lebanon.
However journalists and past governments were totally dishonest because they never disclosed it to ignorant public as why country was still kept on hobbling along even after 3 weeks foreign reserve deadline has past. They never gave credit to foreign remittances and pretended as country did not go bankrupt due to their financial policies or some other special ability.
Only this present government has started acknowledging the role of foreign remittances of overseas Pakistanis in propping up the foreign reserves.