All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
The salesperson is responsible for what happened, as he agreed to the exchange. If we presume that he was not at all given permission (by the shop owner) to do so and he acted out of his own will, and it is not possible to go back to him now and find out whether or not the owner had given him permission, and it is not possible to return the piece of cloth because it is used, and it is not possible to reach him, then there is no harm on you to benefit from it in return for your right with him, which is the price of the first piece if the price of the two pieces is the same. However, if the piece that you took is more expensive than the first piece, then you have to give the difference in price in charity while intending the reward for the shop owner, if you cannot deliver that difference to him.
Allah knows best.