Not really there is a lot of overlapping mechanics and I need to do a fair amount of testing to demonstrate possible issues.
Uh huh. You realise these sorts of things are much easier with more testers, right? I'm not going to be impressed by your 3,000-hour claim here, either. A few posts back you tried to tell me I imagined taking Capua.
When I say realms, I mean independent realms. The law should stop transfer between independent realms, it does not stop internal transfer between vassals. I'm thinking about all the conditions involved in stopping an internal transfer and although you could probably do something simple, enforcing edge cases becomes difficult.
Should it only apply to Independent realms, though? That's like saying the laws preventing inter-vassal warfare should only apply to your direct vassals. The mechanics of this are not all that complicated. If you enforce the rule that no title should ever change liege then you just need to find the first heir who doesn't hold a title with a different liege. If that person later inherits a higher title in another realm they either retain the same liege, if possible, or they forfeit the lower title to the next valid heir.
This would probably lead to, say, the son of the Duke of Normandy usually being Earl of Somerset under the Duke of Wessex but that's not actually a problem as far as I'm concerned. Eventually the title would pass out of the direct line when it was inherited by a brother or uncle. That is how Feudal inheritance actually worked in reality in some cases, people had to forfeit titles in order to ascend to higher ones.
I'm convinced there's something wrong here, because a Dev hasn't come in yet to say this isn't a bug - and the more I think back the more I'm sure I saw exactly the same thing happen in Croatia under the same circumstances. Vassal inherits higher title, leaves realm.