Hi,
Kindly check the following while making the sale entry :-
1) Class ID should be same as purchase
2) Security Account should be same as purchase
3) General Valuation Class should be same as purchase
4) Portfolio should also be same.
5) Sale date can be on the same date as purchase or later date.
Warm regards,
Akhil Poddar