This is illegal due to various reasons. Employees can be retrenched but for valid reasons. The employees shall be retrenched in the order that t should be the LAST person employed to leave first from the company.
The company B arrangement is a sham contract. The outsourcing company is only a camouflage and you will be continuing your work using the same computer, sitting on the same chairs, reporting to the same managers etc. This is illegal.
In the present situation many are trying to avoid employees using many tricks. This is one of the ways. If you react, you will lose the job. You will not be able to approach any dispute redressal machinery because in the present situation nobody attends to all these issues and therefore, it may take time even to hear your grievances. Alternatively, if you accept the offer, you can continue there, transfer your PF (from parent company to outsourced company) and forget about the other benefits