This isn't just about the Chinese government, any foreign government that provides soft loans, aid, or financial assistance, war reparation projects to other countries operates in a similar manner. Just look at foreign aid agencies and international contractors working on international projects funded by soft loans from foreign governments. This is also the way to claw back some money. Also in the past you saw a lot of American, European, Australian, Canadian working on the oil/gas, mining industries in Borneo, Papua, Sumatra, South Sulawesi, etc.
Before the influx of Chinese workers, many Japanese foreign workers were involved in power plant, dam projects, building manufacturing facilities in Indonesia funded by the Japanese government development fund or Japanese banks.
For this foreign funded project, it is easy to demonstrate that there aren't enough local workers qualified for the job. Simply include in the job description a requirement for prior experience on similar projects of the same scale, the ability to operate certain machine without close supervision, fluency in foreign language or the like. This approach would effectively filter out a large number of Indonesian applicants who may not meet the necessary requirements. Also, it makes sense since many people prefer to hire individuals they have previously worked with, ensuring they know the quality, work ethic, sub-culture and values they can expect.