Thank you. First of all, I am sorry to hear about the issues brought up by this. It must be a frustrating situation to be going through.
The answer lies in the link you provided above, specifically the definitions part of The Maternity and Parental Leave etc. Regulations 1999.
It defines ‘childbirth’ as “the birth of a living child or the birth of a child whether living or dead after 24 weeks of pregnancy” (I have underlined the relevant part above).
As you can see, as soon as a living child is born, then that satisfies the definition of childbirth and the 24 weeks is no longer relevant (which only applies if the child was stillborn).
If your child was born alive, then it has satisfied the definition of childbirth, which you can then go on to apply together with the rights further on in the Regulations.
For example, in Reg 6:
https://www.legislation.gov.uk/uksi/1999/3312/regulation/6/made
(2) Where the employee’s ordinary maternity leave period has not commenced by virtue of paragraph (1) when childbirth occurs, her ordinary maternity leave period commences with the day on which childbirth occurs.
We already know you have satisfied the definition of childbirth and therefore would be entitled to ordinary maternity leave to start on that date. Maternity pay also follows on from that.
Failure to adhere to the legal regulations as above could amount to pregnancy/maternity discrimination and could be unlawful, allowing you to claim for potential compensation.