Comparison with Bangladesh doesnt work.
Pakistan has been at a constant state of war with various factions of terrorists last two decades because of supporting the US WOT and in the 80s (Afghan War). Took record number of Afghan refugees and businesses failed to invite investment as weren't competitive because of terrorism.
Sharing official gov doc outlining $123.13bn losses because of war on terror for just 16yrs till 2017. And this doesn't include the human losses and the additional expenses by the armed forces. Remember this is the same period Bangladesh made great progress, even several Pakistani manufacturers shifted factories to Bangladesh in this period.
Most of the borrowing was because previous governments artificially stabilized PKR by pumping in borrowed dollars this is a short term measure meant easing inflation during their tenures, this is no longer the case and PKR value now on free market mode. Things are normalizing and figures will improve now on. Pakistan is also making massive loan and interest repayments as they are becoming due now. So lessons have been learnt and something is being done.