Projection. Westerners hold the vast majority of the debt of developing countries, which they leverage to gain control of their domestic policies and enact exploitative policies that extract as much wealth as possible while the countries themselves are unable to develop beyond being resource colonies. China frequently forgives the debts of developing countries and invests in actual infrastructure and development without making domestic policy demands.
https://en.wikipedia.org/wiki/Debt-trap_diplomacy#Domestic_Chinese_experience on some quick preliminary reading it seems like this is generally backed up though time will tell.
Regardless, china does still engage in predatory behaviors, especially with their military, they engage in super aggressive forms of power projection over the parts of the sea they consider "theirs" that other states don't agree with. As well as the numerous examples of chinese aircraft in international airspace causing problems.
even ignoring these two things, i wouldn't be surprised if this was a short term loss, long term gain expectation, not dissimilar from theories of venture capital funding.