My story on something like this:
Back in the 80s, my first ex and I were already separated, but not yet divorced. I determined to be a surrogate mom for my sister and her second husband (she’d had her tubes tied after her first divorce and the cost to reverse was prohibitive with only a 50% chance of success).
The lawyer that handled the surrogacy was also my divorce lawyer. Turns out, because I was still married, even though the paperwork was in progress for the divorce, had I become pregnant before the divorce was final, my ex would’ve had claim on the child, even though his DNA was nowhere near the child.
So once the lawyer got the final decree on the divorce, he put the surrogacy documents through.
The child of that relationship is now 35 years old. I married my second husband halfway through the pregnancy.