A:
There is no wrong in
repurchasing the sheep which you had previously sold to him, (Part No. 13; Page No. 144) and he was unable to pay for them. The purchase price should be according to that which you both agree on. The value of the sheep is to be deducted from the amount the seller owes you. This is not prohibited as long as the price for which you bought the sheep is equal to the price for which you had sold it or more.
May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.