But is it a bug that the character changed realm? The knights should, I think, but it seems weird for the Duke.
The Duke loses his title, but will then still be aligned to the region as a simple estate-less Noble. And since the region switched allegiances, the former Duke does too.