which bumps him to ruler and duke of duchy B + lord of X, whilst duke of duchy A keeps both lord and duke title, but duke B gets the boot back into a nobody (or ex-somebody)... eh?
Wrong
the other scenario would be lord X becomes ruler+duke of duchy A and lord of X (thus region X joins duchy A).... old duke of A becomes a plain old lord of Y... but that doesn't really make that much sense either.
Wrong
the other alternative is simply.... lord X becomes ruler + duke of newly created duchy C.. a new duchy created every time... otherwise... eh.. where do you place the booted ruler/duke? but the issue there for tim is that there's a proliferation of duchies...
This is the scenario being discussed, except that the duchy C isn't re-created every time. It would be a "special" duchy where the current ruler is also always automatically the duke. The old ruler would keep his region and it would stay in that duchy, but he would no longer be its duke. He can, of course, switch the allegiance of his region to a different duchy.
Also, this would only be true for rulers that are also region lords, but not dukes at the time of their election. If the new ruler is either not a region lord or is also the duke, then nothing changes.
Then again, we also need to think this one further down, as a ruler could also be a knight, but not the lord. And there's little we can do there.