This is not true. For most of Pakistan's power plants, the loans (denominated in US dollars) were given in exchange of sovereign guarantees by the State of Pakistan. So, the capitalists, in theory, don't have anything to worry about. The whole country could switch to renewables, and the State of Pakistan will still have to pay back on their investments. The reason for the sovereign guarantee is because Pakistan does not have a stable political landscape, so the free market risk is too high for such large investments.
In practice, the government is forcing local investors to renegotiate some of the loan terms or contracts to reduce its payment obligations [1]. When I say forcing, I mean, mafia style. It's not clear how much this will help.