You are very much mistaken if you believe that China is economically stable. It is true there was the expected economic growth and wealth creation when in the late 1980s China abandoned doctrinaire socialism and allowed some economic freedoms to its underproductive, inefficient masses with the communists still controlling central banking and capital allocation ( to their detriment).However the nation’s economic well being depends on the export of consumer products ( mostly designed by foreigners) that cater to foreign markets and tastes. The trade surpluses are absolutely necessary to support the military, the non productive huge bureaucracy and guarantee the import of essential grains, materials and energy. Its, at this point, a very precarious balance. Economic and overt military imperialism is necessary for China to prosper and even survive.
[Economic and overt military imperialism is necessary for China to prosper and even survive.]
https://en.wikipedia.org/wiki/Zhao_Gao#Coup_following_Qin_Shi_Huang’s_death
The Sui dynasty collapsed when its ruler went after the proto-Korean empire of its time. That ruler was killed by a courtier:
https://en.wikipedia.org/wiki/Emperor_Yang_of_Sui
Something similar happened with the China’s last de jure dynasty:
https://en.wikipedia.org/wiki/Ten_Great_Campaigns#Campaigns_in_perspective
Huge amounts of money were spent, leading to eventual dynastic collapse.
The basic point being - whatever China’s problems or lack thereof, military campaigns abroad add to those problems rather than solve them. China’s rulers are not so much far-sighted as they look back upon the past to divine the correct approaches to the problems of the day. If Xi Jinping is having serious problems at home, he’s not going to venture abroad. These rulers have tended to indulge in foreign adventures only in times of domestic peace - much like every other ruler out there. Because all rulers need to watch their backs - while you’re focused on managing a foreign war, your rivals are circling and waiting to stab you in the back.