If China can't make this project work China will lose everything having an empty port, same as India having an empty airport there.
There are certain countries where China's countries strategic interests are more important than monetary profits. Those locations are Venezuela, Pakistan and sri lanka.
Do you think that when china gave loans to Venezuela they had repayment in mind? Even when Venezuela was in a stage of financial breakdown china kept on providing loans. China was seeing at losses but they had their eye on their oil. So when Venezuela couldn't pay them in money, china demanded oil instead at discounted rate.
In case of sri Lankan hambantota port, why did china invest in there when there is a perfectly capable, well capable and established Colombo port a few NM away? Did they really think that traffic would start coming there? No they didn't, Chinese aren't fools to think so. Again their strategic interest of getting a port (which possibly get converted to a naval base In future) close to India prevailed. And when sri lanka couldn't pay back, they achieved their objective. Yes, sri lanka refused to allow them to use a military base but still they can use it observe and gather intelligence.
I ask you what China did to make this project profitable? India is not there to make money, our objective was clear, its to keep an eye on china's port.
Similarly in the case of Pakistan, there is Karachi port nearby and its used extensively, generates a lot of business. Why Gwadar then? Because its located at the mouth of Gulf of Oman and china imports a major share of their oil from there. Today if china's oil reaches them going through the indian ocean and reaches SCS through the strait of Malacca, after Gwadar its all gonna through that port and directly to mainland china bypassing indian ocean. Its a win win for china. If the port generates revenue, china makes money and still gets to import oil from oil, if it doesn't china still gets to import oil. China doesn't has anything to loose in Gwadar, they just want a safer route for their oil which they are getting. But ask yourself what if it doesn't make money? How do you repay the staggering amount?