You’re right, it’s an issue.
One possibility is that there’s some cultural accommodation to common practice – maybe assignations with paramours are limited to certain periods of the year, so everyone’s very clear whose kid is whose, or birth control is specifically devised around assignations? Seems like it would require a lot of trust among the various parties.
Another possibility is that inheritance law might adapt. You might have a scenario where Arianne can give her inheritance to her first child no questions asked, but her husband could decide to name his paramour’s child as his heir if he thinks the oldest isn’t his.