No – your employer cannot force you to become self-employed because this would effectively be dismissal which would be unfair for a maternity-related reason (and so unlawful).
Furthermore, if you continue doing the same job, to the same specifications and under the same control but with the label of being “self-employed” the likelihood is that you would still be deemed to be an employee if this were to be challenged legally.
Please read the Self-Employed Policy for more information on self-employment.