This sentence comes from Han Feizi's Zuo Zhuan on Han Feizi's Foreign Storage at the end of the Warring States Period. The original text is as follows:
Some Chu people sold their pearls to Zheng, Mulan's cabinet, which was preserved with cinnamon, decorated with pearls and jade, decorated with roses and jade. Zheng people buy rafters and return pearls. This can be said to be a best seller, but it is not a good pearl.
During the Spring and Autumn Period, there was a businessman in the State of Chu who specialized in selling jewelry. On one occasion, he went to Qi State to sell jewelry. In order to do business well and sell jewelry, he specially made many small boxes out of precious wood, carved and decorated the boxes beautifully, so that the boxes gave off fragrance, and then put the jewelry in the boxes. A man from Zheng saw that the box containing the orb was exquisite and beautiful. After asking the price, he bought one, opened the box, took out the treasure inside and gave it back to the jeweler. This is really good at selling boxes, not pearls.
An idiom derived from this article is to buy bamboo slips and return pearls. Pronunciation is midú huá nzh. The original intention is to buy a wooden box with pearls and return it. Metaphor has no vision and improper choice.