I like the idea, but even if with inheritance allowed through the female line or by women (the former was much more common than the latter) wouldn't his son have a better claim? This doesn't mean that it is a bad idea; it should be possible to force him to make him accept his grandson (from the female line) instead of his son. Kind of like the treaty between Stephen of Blois and 'empress' Matilda, which made Henry d'Anjou, the son of Matilda, the heir of Stephen instead of Stephen's own sons.
However this will probably not always apply for all titles, for instance they may lose the kingdom with the royal demesne*, but are allowed to keep an ancestral duchy and/or county(/counties).
* = I hope that a distinction will be made between royal and personal/dynastic demesne, the latter may become part of the royal demesne after a dynasty goes extinct.