Just to clarify: Do you mean something like the First Opium War (1839-42)?
Googling when did China fall behind Europe lead to a non-alternative history forum that suggested that China had started falling behind technologically sometime around the 16th century or so.
As I recall early 19th century China didn't have much of a navy, while
there had by that point been a song about what Britannia does to
the waves for some sixty years or so.
If you're talking about an early 19th century British expedition to China, this is not going to happen so long as a certain Corsican Emperor is trying to take over all of Europe.
The 18th century is very iffy though, as the technological difference isn't that great, and this was when the Qing under Qianlong (not the old, complacent, semi-senile man that Lord McCartney encountered in 1793) were at its peak, having doubled the size of its territory, including defeating the Russians numerous times. This was also before the numerous corruption scandals drained the Qing Treasury, such as the eunuch Heshen who had been made finance minister but ended up bankrupting the Qing near the end of Qianlong's reign. Plus, even getting a sizable British force to China safely would have been a challenge in and of itself.
The British in 1839 caught the Qing at precisely the worst possible moment. The Chinese had suffered numerous internal disasters and crises even before the British had shown up. The Grand Canal had just gone bust, taking a third of the Chinese economy with it. They'd just suffered the White Lotus Rebellion. The Daoguang Emperor was also an incompetent who surrounded himself with the most traditionalist purists who told the Emperor what he wanted to hear. The British just exposed these in the worst possible way...
Ruled by a more competent administration, it probably still would have been a loss in that particular conflict, but not the continuous cycle of futility that plagued China for the rest of the 19th century.