Btw:That is false. A duke decides that realm B has better name or cooler flag than there current realm, they can change allegiance. A duke decides they just don't like the look of the map with their duchy a part of their current realm, they can change allegiance. A duke decides that they would rather be addressing 40 nobles instead of 20 when they address the realm, they can change allegiance. A duke decides that the land needs more nobles to reign it in, they can change allegiance.
Btw: no it's not.
There's a difference between a duke seceding with 10 out of 40 nobles and a duke seceding with 8 out of 10.