At risk of repeating myself, I covered certain dimensions of this in these past answers, but only tangentially:
The thing to stress is that we cannot, and I do mean cannot, view China in the nineteenth century as a unitary nation-state. The Manchu-founded Qing Empire was never fully able, among the Han Chinese, to dispel the idea of its being essentially foreign. That's in large part because the Qing so strongly identified itself as a Manchu-founded state – not necessarily a state that was built around giving Manchus (and more broadly, Bannermen – those enrolled in the Eight Banners, irrespective of specific ethnic origin) exclusive privileges as a defined ruling elite, but still one that often conceptualised itself as resting on the foundation provided by a loyal, ethnically or at least culturally distinguished caste of elite soldiers and favoured administrators. That is not to say that there was a continual atmosphere of distrust, but it's hard to argue that there was ever a time when the ethnic paradox at the heart of Qing rule – a 'barbarian' polity claiming Chinese modes of legitimacy, while continuing to assert its ethnic separateness as a ruling caste – did not hang in the background of any event in Qing political history.
The eighteenth century saw two notable events that highlighted this. The first was the 1727 Zeng Jing conspiracy, in which the eponymous Chinese scholar attempted to raise a revolt against the Qing by winning over the Han Chinese general Yue Zhongqi, appealing to his ancestor Yue Fei whose claim to fame was his dogged resistance against the Jurchen Jin, ancestors to the Manchus. The Yongzheng Emperor's correspondence with the imprisoned Zeng Jing, edited and published as the Dayi juemi lu, which is often taken as proof of Qing acculturation owing to its arguing that the Aisin Gioro line, and Manchus writ large, had gained legitimacy through their migration to China and absorption of Confucian values, but as Pamela Crossley points out, the ideas about political power expressed in the text are nonetheless firmly rooted in Manchu and more broadly Northeast Asian conceptions of political ideology. The Qianlong Emperor, who objected to the idea of such transformations and had the work proscribed, faced the second of these events in 1768, when a spate of queue-cutting incidents aroused fears in the imperial court that there was an underground anti-Manchu conspiracy, whose members were cutting other men's queues as a form of political protest – even an attempt at sorcery – against the Qing state. Needless to say, the Qing state of the eighteenth century was extremely concerned about the need to thread the needle between maintaining an image of legitimacy while maintaining a separate Banner identity for its elite caste.
This sort of ethnic tension fundamentally coloured the period of violent encounters with Western states from 1839 onward. I discuss the full political context here so I'll jump right into the specifics. While the Canton System, which restricted international trade to a single port, was not, as has often been argued, a form of isolationism, it was nevertheless a means of more firmly regulating commerce and commercial contacts, especially individual Western merchants and missionaries. As argued by Song-Chuan Chen, among others, the Qing were absolutely concerned that Han rebels would join forces with foreign agents and attempt to overthrow them, which was part of why they were so concerned with constraining the movement of people under the Canton trade arrangements. This paranoia would be affirmed – or rather, it would be acted upon and retroactively justified – during the Opium War itself. Qing commanders in Canton attributed their defeat to columns of Han traitors; the Manchu garrison commander in Zhenjiang, named Hailing, declared martial law and wantonly inflicted corporal and capital punishment on Han civilians. The war would be concluded by negotiations conducted by two Manchus, Kiyeng and Ilibu, and this contributed to an eventual stab-in-the-back myth promulgated by the Han literati. This argued that the war could have been won, but the Manchus, whom they believed saw China as merely an imperial possession and did not care for the Han, threw away their chances at victory. Among the literati, the 'humiliation' here was not that Britain was more powerful, but that their own government refused to prosecute the war successfully.
The Taiping Heavenly Kingdom, which emerged to challenge Qing rule in the 1850s and 1860s, appealed to the notion that China had been humiliated by foreign invaders, but not by Europeans. Rather, it was, again, the Manchus who had inflicted this humiliation, to the point where the Manchus were being blamed for the opium trade. As one Taiping propaganda piece claimed,
For a land as extensive as the eighteen provinces ['China Proper'] to be under the yoke of the three provinces of the Manchu dogs, and for five hundred million Chinese to be subject to a few million Tartar devils is indeed sufficient cause for extreme shame and disgrace. Moreover, each year they transform tens of millions of China's silver and gold into opium and extract several millions from the fat and marrow of the Chinese people, which are (sent to Manchuria and*) turned into rouge and marrow.
(* there is a difference between two versions of the text)
The Qing would actually resurge as an imperial power after the defeat of the Taiping in 1866 – or indeed you could argue they had already started resurging as part of that victory – leading to a period in which although there was still the idea that China had some catching up to do, there was reasonable confidence that it was doing so mostly successfully. This all changed in 1894-5, when Japan defeated the Qing army and navy in a struggle over dominance over Korea. What did not change, however, was the nature of the response. While there was some resentment against Japan, the more critical thing was resentment against the Qing, where there was again a stab-in-the-back narrative that the state could have continued fighting, and signed the Treaty of Shimonoseki out of cowardice. Japan was, in fact, the model for many of the intellectuals who protested in 1895 and went on to spearhead the reform movement: Kang Youwei and Liang Qichao made a place for themselves in Japan after fleeing the crackdown on the reformists in 1898, but many reform advocates had in fact studied there beforehand. The Meiji Restoration's apparent success at achieving Japanese modernity was something that served as a model to emulate, and an indictment of Qing passivity, but not a demonstration of any inherent Chinese weakness.
Indeed, Japan would be a critical place of support for more than just the constitutional monarchists. The largely emigre republican movement also had close ties to Japan and its intellectual currents: After the Revive China Society's failed revolt in 1895, many of its key members, including Sun Yat-Sen and Yeung Ku-Wan, set up shop in Japan; Sun's protege Wang Jingwei had been studying in Japan for two yaers as part of a Qing-sponsored programme for overseas students when, in 1905, he was recruited into the republican Tongmenghui; Chiang Kai-Shek was a student at a Japanese military academy from 1907 to 1911. If Japan was supposedly the fount of China's recent humiliation, many Han Chinese certainly didn't act like it.
As discussed in the answer linked by /u/Cormag778 (for reference, this), the notion that 'national humiliation' was the result of outside action came mostly after the 1911 Revolution, when overthrowing the Manchus, the arch-'humiliators' up to that point, had failed to solve China's problems. It is telling that key terminology in the discourse of externally-caused 'humiliation', such as 'Unequal Treaties' and 'Opium War' (!) entered the Chinese lexicon mainly in the 1910s and 1920s. Even then, there were voices that pointed to internal weakness as the source of China's humiliations, most prominently Mao Zedong. The modern notion that China was fundamentally humiliated from without has resurged mainly after the 1989 crackdowns, which led the Communist Party to pivot to externally-antagonistic nationalism over internal class struggle as the organising principle of the People's Republic, and bring focus mainly to episodes of 'China vs the world' over China's struggle against itself: the Taiping were sidelined in favour of the Opium War, and in recent decades, the Chinese Civil War has been sidelined in favour of the Second Sino-Japanese War, and in particularly recent years the Korean War.
To pull all the above together, the key thing to get across is that while the Qing remained in power, all the events that are retrospectively framed as 'national humiliations' in which external powers unilaterally brought down a unified, unitary 'China' were nothing of the sort. The Han response to these events was to continue to assert the notion of Chinese strength, and pin the blame on the Manchus for being uncaring rulers who allowed China to be defeated. In a sense, the 'trauma' had already existed in the form of the Manchu conquest, or rather was construed as such. Only after the ethnically-rooted revolt of 1911 did the narrative shift to the idea of China's being weakened entirely from beyond the Qing Empire, as opposed to having its always-latent strength constrained by its own rulers.
While there's always more to be said, you might want to check out the wonderful write up on the historiography of the supposed 'century of humiliation' (which is what I assume you are referring to) by u/EnclavedMicrostate. It can be found here. It doesn't directly address your question, but I think it provides an important framework in understanding what your question is asking and enriches our understanding.