I'm neither a doctor/midwife nor a train driver, and I would be very surprised if there is anyone who is both and could give their view on this, but I imagine that the psychological impact of delivering a stillborn baby for a doctor/midwife is similar to the psychological impact of hitting someone who throws themselves in front of a train for a train driver. You know it's something that could happen in your line of work, but it is thankfully rare and utterly awful when it does happen.
We recognise that this is a highly traumatic event for the train driver. They get counselling and paid time off afterwards to help them process it.
I suspect that doctors and midwives get less support due to lack of resources and the perception that death is a normal, everyday occurrence for medical professionals and they should be able to deal with it, even though it isn't actually an everyday occurrence for midwives and obstetricians the way it is for, say, oncologists, palliative nurses and paramedics.
If you said to a train driver, "Someone wants to off themselves, they've had counselling and they're sure they want to do it, they'll be throwing themselves in front of the 8:36 to Bolton so make sure you don't try to stop", I think anyone in their right mind would think that was barbaric.
Asking a doctor to stop the heart of a full term healthy human baby and then deliver it dead rather than alive would also be barbaric. No one is going to want to do it, or feel any moral obligation to do it. So unless you want to force them to do it, making it legal for them to do so is a waste of time.