This is always a very difficult situation and seems, on the face of it, to be contrary to the Constitution and other legislation.
It must be said, however, that there are circumstances in which a pregnant employee can be retrenched, provided that the matter and the facts have been fully aired and considered.
It would have been good to know in which court this decision was taken and what the process was that was followed in your case.
I must also note that I am somewhat confused by the reasons that your legal team provided to you – I think, as a quick response to your question, that you should obtain a more comprehensive explanation from the attorneys.
I will be happy to provide you with a more comprehensive response to this issue – please do submit another question to the website.