Holding haram share to cover investment

slms if a person invested in shares and Never used to check wether shariah compliant or not but now they are and have realised they have a few shares in their portfolio that aren’t sharia compliant but they are in negative balance. Can the person then Wait for the share price to go up and they can then take out the money they invested or do they have to take the money out now now and sit at a loss. The loss combined is a few thousand pounds. The persons intention is to cash out as soon as they cover the loss and has no intention taking any profit from these non compliant shares.
Pls advise jazakallah

Wa alaykum salaam,

You may wait to get your capital investment back. That’s the only right you have had since the beginning of the unlawful investment.

Allah knows best