I believe what you cite is not Catholic teaching but Patheos’ incorrect interpretation of CUF’s article on the topic. The Pathoes article argues against Catholic moral theology.
For an accurate explanation of Catholic teaching see: https://www.ncbcenter.org/files/9514/6984/9801/MSOB052_When_Pregnancy_Goes_Awry.pdf
> This threat is addressed by removal of the tube, with the secondary, and unintended, effect that the child within will then die. In this situation, the intention of the surgeon is directed towards the good effect (removing the damaged tissue to save the mother’s life) while only tolerating the bad effect (death of the ectopic child). Importantly, the surgeon is choosing to act on the tube (a part of the mother’s body) rather than directly on the child. Ad- ditionally, the child’s death is not the means via which the cure occurs. If a large tumor, instead of a baby, were present in the tube, the same curative procedure would be employed. It is tubal removal, not the subsequent death of the baby, that is curative for the mother’s condition. Some say that cutting out a sec- tion of the tube with a baby inside is no different than using methotrexate because, in either case, the baby ends up dying. Yet the difference in how the baby dies is, in fact, critical. There is always a difference between killing someone directly and allowing some- one to die of indirect causes. We may never directly take the life of an inno- cent human being, though we may sometimes tolerate the indirect and unintended loss of life that comes.