BEIJING—President Xi Jinping got the credit as China’s stock markets revved up. Now their unraveling is inviting rare finger-pointing at his forceful rule and putting his far-reaching economic goals at risk.

Vibrant stock markets are at the center of Mr. Xi’s plans for an economic makeover, intended to help companies offload huge debts, reinvigorate...