a quick band-aid would be an announcement post.
something like
"duchy flipping is a bit buggy atm. you are not meant to be able to flip the last duchy. don't do it."
the issue is not whether it's a merger, that is sort of irrelevant. the person who flipped the duchy is ultimately responsible for flipping a duchy that isn't meant to be flippable.