The partner withdrawing from the partnership stipulated that he will share in the profit of the share he sold
The scenario mentioned in the question is impermissible and the contract is Batil (null and void) because it involves
a double sale. This is because the partner withdrawing from the partnership stipulated that he will share in the profit of the share he sold and to which he is no longer entitled. Moreover, this contract involves Gharar sale (fraudulent transaction where the details about the sold item are unknown or uncertain) and Jahalah sale (sale with lack of knowledge) due to the condition laid down by the withdrawing party of sharing the profits but not the losses. If there are any disputes between them, they can resort to the courts.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.