You’re dealing with the “Double Effect” issue. The Vatican has not ruled on this, in specific language anyway. Other Catholic theologians have reasoned it through, however. Here’s how it goes:
It is not permissible to remove a living embryo/fetus from a fallopian tube with the intent of killing the baby but saving the tube. This is a direct abortion. Modern surgery is not quite capable of doing this yet, but the drug Methotrexate can be effectively used for this purpose.
It is permissible to remove a diseased organ, even one containing a live embryo/fetus, if leaving the organ alone and intact will almost certainly result in the death of the mother, which then would obviously result in the death of the baby. One such circumstance is when a strong likelihood exists that the mother would bleed to death when the tube inevitably ruptures. Another circumstance could be cancer of the womb. Sucn surgery would not be a direct abortion, because the primary intent of the surgery is to heal, not destroy. If surgery is done under these circumstances, provisions should be made to immediately baptise the baby
We do have cases on record where the fallopian tube ruptured, the baby implanted outside the womb, then was delivered alive and healthy by c-section between the 7th and 9th month. They are rare, but they happen. About 10 years ago a British woman gave birth to healthy twin girls who developed inside the womb, and their healthy triplet brother who implanted inside the fallopian tube, ruptured the tube, and grew to near-full-term between the womb and the bladder.
Obviously, nothing is completely certain, and everything is possible with God. However the best of us recognize that God gave us intelligent brains and capable hands.
It is always permissible to remove an embryo/fetus that died naturally, using whatever means can be safely employed.
Hope this helps.
Nan