Chinese soldiers and chinese equipment, though outdated by the standards of the time, are perfectly capable of defeating European military, on the off chance when they were sufficiently organised[2][3]. The heroes of the late Qing Empire shone, because around them, their colleagues lie low in the depths of corruption and incompetence. It's like a game of Starcraft, even with a bigger army, and bigger economy, an inexperienced player making a couple of mistakes will lose the game quite easily to a more experienced one.
[1] https://en.wikipedia.org/wiki/Taiping_Rebellion#Affectness_o...
[2] https://en.wikipedia.org/wiki/Battle_of_Taku_Forts_(1859)
[3] https://en.wikipedia.org/wiki/Battle_of_Cầu_Giấy_(Paper_Brid...
For historical interest, during the high point of the Ming empire, junks achieved in battle, decisive victories over Portguese caravels armed with cannons[3][4].
The Taiping Rebellion can't be discounted when looking at the inability of the Qing Empire to cope with Western gunboat diplomacy. Wikipedia lists it as possibly the third most bloody war in the history of mankind[1], and besides dragging on for fourteen years and devastating some of the most productive areas of China, the government nearly fell, and increasingly impoverished and ineffective Manchu banner military forces were phased out and replaced with more regional, semi-private local forces, outside the traditional chain of command, raised and led by men like Zeng Guofan, Li Hongzhan and Zou Zongtang. While these initial commanders were more or less loyal to the Qing government, it arguably started the slide towards warlordism.
[1]https://en.wikipedia.org/wiki/List_of_wars_by_death_toll