Keep in mind outsider armies were used to the idea that you can venture into China and just beat Chinese rifles and swords-armed mobs up. Eventually, the emperor would agree to an unfair treaty.

The Japanese were the unlucky ones who learned that this had changed. It could just as well have been the Brits, French or Americans.
Being Japanese, they did probably not want to look inferior to the Europeans who had demonstrated Chinese defencelessness conclusively, after all!