I am a little confused here. Don't abortion tablets simply induce labour / expulsion of uterine contents? If the fetus is non viable that will obviously lead to it's demise. But they don't directly cause fetal death.
In this case the fetus was of a viable gestation. Most babies born at this gestation would be born alive. And it would appear an ambulance was called when she was in labour? Surely she may have anticipated the infant would survive and merely wished to end her pregnancy? If she called or asked for an ambulance to be called then in a sense she sought medical help for the baby also?
Obviously it would have been better to have laboured under medical supervision but having a bad labour outcome, however irresponsible your choices leading into that outcome isn't and shouldn't generally be a crime, and particularly if medical help is sought (which it seems like it was). If she has asked for medical induction of labour through a sanctioned route for eg mental health there would be no issue here. She would have the right to decline interventions such as CS etc. So I fmt understanding is correct then no I don't think CPS was right to prosecute. I don't think wishing to end a pregnancy should ever be a crime.
I make a distinction between wishing to end a pregnancy (which I personally feel should always be a legal choice) and feticide (which sometimes may result from the former, but if independent of the former has the potential to be a crime depending on circumstance). Eg I would feel differently if she took something to intentionally kill the fetus (at 33/40) before birth but I'm not sure that is what has happened here?