The TVTropes Trope Finder is where you can come to ask questions like "Do we have this one?" and "What's the trope about...?" Trying to rediscover a long lost show or other medium but need a little help? Head to Media Finder and try your luck there. Want to propose a new trope? You should be over at You Know, That Thing Where.
It usually falls under Creator Provincialism.
Actually might be Aluminum Christmas Trees:
The late Roman Empire explicitly enforced this sort of thing (it's actually more common than a biological child inheriting the title of Emperor). Inheritance in Medieval Europe gets extremely complicated- some states like England specifically required blood relation to inherit noble titles, but the "the title comes with the castle" sort of inheritance was a big thing in a lot of Europe. You'd get a lot of mixed situations too- Alan the nephew nobody likes might get the noble title while Bob the adopted son gets the land and the money (this is how some wars got started)
Critical Research Failure and Dan Browned
or else Accidentally Correct Writing
It was common in the Western world for teenage kids of nobles to receive part of their education in the household of a different nobles. It had the same advantages as present-day student exchange programmes plus X was less likely to lay siege on your castle if X's kid was inside it. If shit did hit the fan, as Scorpion 451 says, we can well imagine that X's kid switches allegiance (willingly or not) and may even become the heir of his progenitor's enemy.
I started following My Next Life As A Villainess All Routes Lead To Doom, and I noticed a particular issue of the author not doing enough research, and thus applying Japanese customs into what's supposed to be a Medieval European Fantasy universe. Specifically, several nobles have adopted, or discussed adopting, distant patrilineal boys as heir. Japanese nobles did frequently adopt heirs, even now, but my knowledge of European history tells me it's unlikely.
I know there're several tropes related to the (lack of) research, but this is the first time I seriously thought about applying one of those. So which trope is it?