Hmm. That's interesting. I haven't observed that with the marriage thing in place, but it has been known to occur both with and without that marriages are not cleanly "disconnected". There's actually two forms of "marriage" recognition: A. The family tree line, and B. The "married" bit set in relationships. The game GENERALLY tests for the marriage bit, not the family tree, and the marriage bit not being properly disconnected has been known to block remarriage attempts. However, this is a mysteriously unexplained bug, as it doesn't happen consistently and the sticky-marriage effect did not appear in testing of the marriage line hack.
So even with your mod (now that I know it's yours), the "married bit" shouldn't be ticked, only the family tree? In other words, the relationship shouldn't show ticks in the married box and they shouldn't show as spouses?