But didn't merchants still use the capital to mainly buy land and become landed gentry after they gained a certain amount?
There certainly was a gentrification of the merchant class, just as there was a mercantilization of the gentry. But by and large, it is my understanding that the merchants did not suddenly stop doing business once they acquired gentry status no matter what the ideal or even the law was. The most important sources of income for your typical Qing gentryman were
not the "official" income but investments, collecting interest, and commerce. After all, there are few better ways to make the money necessary to support a lavish lifestyle, especially in the world's most commercialized agrarian economy with a government actively supporting trade. As early as the seventeenth century, the anti-Manchu resistance leader Gu Dajun could note with some exaggeration that "there are no officials [including gentrymen] who are not merchants and no merchants who are not officials" in his homeland of Guangdong. People could fulfill their obligations as the elite of society even while being merchants. Some examples: the Huizhou merchants greatly aided the maintenance of the Grand Canal in the 17th century. The Guangzhou merchant Wu Bingjian (himself a gentryman, you've probably heard of him by his European name "Howqua II") could contribute more than 30,000 taels of silver for public works - that would nowadays be around 1.5 million US dollars.
Social prohibition of trade is extremely heavily exaggerated by Westerners in general, including this forum. While it's true that there was disapproval of trade among the Confucian-minded elite particularly before the Taiping Civil War, it was not so great as to prevent gentrymen from the enormous profits of engaging in trade. And by Qing times merchants and gentrymen were cooperators in most parts of the country and the children of merchants passed the examinations in swathes, meaning their social prestige rose accordingly. This is made clear in quotes as early as late Ming times, I'll quote two:
"How should a skilled merchant be lesser than a great Confucian scholar?"
"In old days Confucianism was admired and trade was looked down upon, but in our county trade may be admired and Confucianism may be looked down upon."