I understand it odd in history, but what reason would they have to dispose a queen who co ruled with her husband for years in favor of a child? Not "that's how it was in history" but my players will want a reason for it to make sense in the game world (were again we don't do sexism so no 'cause she was the queen')
In modern day when my grandfather died everything went to my grandmother, when she passed it was passed to there children and grand children.
There are multiple forms of inheritance.
1. Parents own assets jointly. Assets are split roughly evenly between surviving children when they die.
2. Assets are family held. When head of family dies, new head -- their oldest descendant, and failing that their parent's oldest descendant (and recurse) becomes new head.
#1 is what many modern societies use. If you are in an exponentially growing economy where personal productivity is most of your wealth, it works pretty well. But if you are in a situation where assets are your main source of wealth and their utility scales better than linearly, it quickly (in generational time) leads to your assets being split up into smaller and smaller pieces.
This apparently happened in a few spots in Europe, where farms sufficient to support families shrunk to tiny near useless plots over a few generations, and wealthy farmers begat starving great grandchildren.
#2 attempts to avoid this by concentrating the assets. The family gathers assets, like land or whatever, and these assets are not split up. The head of the family passes down to (usually) an adult, and (usually) one that the previous head of the family feels connected to and the feeling is mutual.
2nd children, people who marry into the family, never become the head under this system. They can become
regent, caring for the assets while the new head grows up, but they aren't the head.
2nd chlidren are cared for -- often, married off to other families, ideally their head. Or, given important positions managing the family assets (but not head). Or, if become priests or monks (acting as a backup head if the existing head dies without issue), or go off to war (seeking fortune). Their needs are funded out of operating expenses, not family capital.
A functioning inherited kingdom is going to be following some kind of "one inheritor" pattern, or it will divide apart and fall to either civil strife (due to too many rival power sources) or external threats (due to insufficient cohesion).
If merely marrying into a family was enough to Ursurp the assets, then people who are old allies of the family (often relatives) will object quite strongly. They want people who grew up with them, their cousins, whose family legend is part of their family legend, to be the head. And nobody holds a kingdom without that kind of support and legitimacy.
The rules of inheritance also have to be clear if you don't want constant strife all of the time whenever there is turnover.
Now, if you want fun, read up on English succession. There where rules, but regularly the rules where changed. Lots of blood. The king ruled with the consent of the nobles and the commons; the king had to as the commons to get tax revenue. Often the king and commons fought wars against the other!