The "Chinese government" is not a singular, monolithic entity in the same way the "US Government" is actually a bunch of departments, branches and jurisdiction levels each with competing and sometimes differing interests and goals. (but yes, it is more unified in China in the sticking to party line).
The Chinese federal government has been wanting to make this re-balancing for a long time (a shift away from exports towards domestic consumption, and shifts from inefficient state owned enterprises to companies that can operate more efficiently and are "market oriented").
Where you are also correct is that many of the inflated GDP numbers and "inefficient" investments / capital towards things like ghost cities are mostly driven by state governments, in their attempt to meet the "goals" as stated by the federal government.