Where there's a will there's a way.
Many years ago I heard a story from a naval friend of my parents of how his ship had been stationed at Malta, and one of the young officers was romancing the daughter of a leading Maltese citizen, despite having a fiancee back home. The inevitable happened and she had to confess to Daddy that she was up the duff. The captain and Daddy had a long meeting about was to happen, and all was arranged to the satisfaction of everyone.
The pair were married by the bishop of Malta at a high-profile ceremony with all the upper-crust present, plus the captain and officers from the ship. After the usual speeches and toasts, the captain stood up and said what a great wedding it had been, but unfortunately he had just received orders to sail, so he had to remove the groom from his charming bride. All the officers returned to the ship and sailed over the horizon.
In due course the baby was born and baptised and registered - perfectly legitimate - and then an application made for the marriage to be annulled. The groom had been snatched away from the reception, all the guests could vouch that they had not had a chance to consummate the marriage, so it was null and void.
Young officer then married his British fiance, and his Maltese non-wife was free to marry whoever she wanted as a father to her perfectly legitimate son.