Maybe a scramble for China in the late 1800s with the wrong players involved for China could do it?
Russia takes Manchuria while it has a small population, gets a European plurality, encourages intermarriage, and eventually gets a mostly Russian speaking mostly Christian Manchuria with a Manchu/Chinese/Russian Middle Class that has minimal people feeling excluded.
Tibet-Goes independent, remains theocracy to the present.
Xinjiang-Goes Independent, becomes Islamic theocracy on par with Saudi Arabia.
Interior core-Remains independent, goes Communist, becomes North Korea.
South Eastern China-Annexed by France, governed as one colony by France with Vietnam/Laos/Cambodia. Bilingual French speaking elite by 1920s, railroads connecting all French areas, intermarriage and joint business between different groups slowly normalized. Failed rebellion in the 40s unifies the people, 1950s French becomes mandatory. Another failed rebellion unites the people further. In the 1980s they get independence as Indo-China, become united under the dictatorship of the most well respected independence leader, he continues to push French as the language of business and government, oversees rapid economic development, and still rules. A new synthesis culture has been created with its own identity.
Random chunk of China gets ruled by Britain, becomes a giant Hong Kong and is more or less a Democracy with Anglo Capitalism today. Independent Great Power who consider themselves proud to be Chinese, but looks down on the rest of the country for being relatively poor and unfree.
Random chunk is ruled by Japan, has Japanese forced on them. Japan is a semi-free state today who don’t let it have independence and denies the obvious hatred China has for their rule. Living standards have become too good to just rebel in a war they cannot win, even if they are not exactly happy with the situation. Large portion of the population has also intermarried with Japanese, which in unison with actual Japanese immigrants creates a non trivial portion of the population that is actually Japanese. Like Ireland on a larger scale.
Random small chunk ruled by German Empire. Germany eventually grants them equal rights, and they eventually consider themselves German-Chinese.
Taiwan-Taken by Japan and assimilated into Japan.
Random chunk goes Christian by force during Taiping Rebellion. Portugal takes it and encourages further Christianization, eventually turning them into more mainstream Christians. Grants it independence in the 1970s with a Catholic Theocracy taking over.
Just some random thoughts. Not very realistic, but a series of China screws that might create enough economic, linguistic, religious, philosophical, and ethnic differences to retain their identity in full. Maybe setting them up to functionally cease to exist as a single thing eventually. I think I probably had more fun writing it than thoughts put into it.
Edit: Didn’t see medieval period, and thought it was somehow last possible PoD.