An interesting problem.
The error was easy to find. But thinking about possible ways to prevent it would take a lot longer, so I’m reluctant to try.
The problem: You have Feodor Alexandrovich ROMANOV (Q305) recorded as female, but as HUSB in his family with Irina. So the step-family labels required for F1679 after adding Q306 to F1680 don’t know how to determine step-mother / step-father. Fix his gender and the error goes away. I confirmed this, but then put it back as it was for you to see.
I think the issue is that the “step-xxxx” labels are determined by gender, but family positions are by HUSB / WIFE tags. So you generated a conflicting situation. It makes me wonder how this would behave if it was an actual same-sex couple. It’s making my head spin 🙂