Hopefully you can reproduce it and get to the bottom of it.
Tips to reproduce: I see this worst at the Romance Festival. Just observed two female sims, both with 100% male preference drink some tea and then immediately start flirting with each other in front of their husbands.
Also I had a gay couple dining at a restaurant, and they get the Dinner Date romance moodlet. They started chatting with a married heterosexual couple dining at the table next to them and suddenly there were jealousy reactions all over the place because one of the groups flirted with the other autonomously instead of having any restraint or faithfulness.
When I click on any sims and get presented with random suggested social interactions, I often see romantic interactions suggested that ignore gender preference. For example if I male sim with female preference is in a playful mood and clicks on another male sim, it can suggest "Make a Flirtatious Joke". Before the November 2017 patch I don't recall that happening. Or at least it was tuned differently. The problem is that sims seem to follow the same rules as the suggestions when randomly performing autonomous actions.
I only play one saved game ever, which I've previously submitted for other bug reports.