Imagine a hypothetical king in a monarchy that uses a primogeniture succession law system, in which the firstborn child (usually male, historically) inherits the title.
Suppose that the king suddenly dies, married but childless, and his younger brother, as next in the line of succession, is swiftly crowned as the new king.
Then suppose that, unbeknown to everyone including herself, the wife of the dead king was pregnant and, in the days following the new king’s coronation, she gives birth to a son.
What would be the status of the dead king’s son in the primogeniture succession law system, and what would his place be in the line of succession? It’s possible that such a scenario may have already happened in history, although perhaps not with such a high-ranking title as monarch.
In 1316, Louis X of France died with no sons (he had a daughter, but women did not count in the Salic succession laws). His wife, Clementia, was pregnant, however, so Louis’ brother Philip, who was his heir, decided to wait to see if Clementia had a son. John was born, but he only survived for five days. When he died, Philip became King Philip V of France.
Technically, John was not counted as a King until 1350, when John, the son of King Philip VI, succeeded his father, at which point he decided he was John II.
IIRC almost this exact scenario played out in late 19th century Spain. The only difference from the OP was that the late king was survived by a daughter who would’ve become queen had the unborn child not been born a boy.
People who follow primogeniture know how to count to nine. They wouldn’t overlook the possibility of a posthumous son. Hypothetically, there would be a grace period before crowning the brother in order to be sure that there was no such potential child. That’s assuming that, hypothetically, they don’t decide to do it another way.
Most divorce proceedings have a gap between the time that the divorce is granted and the time it takes effect for pretty much the same reason.
This has happened at least twice in European history: John I of France (as mentioned upthread, he lived only five days) and Alfonso XIII of Spain, who ruled 44 years (1886-1931) and had a pretty shitty time of it.
It would be interesting to know if there was a case where succession was put on hold due to a pregnant queen, who ultimately had a girl.
Recall that Thomas Seymour secretly married Catherine Parr - Henry VIII’s widow - only 4 months after Henry died. This was considered scandalous, and he eventually had to get forgiveness from the new King. Widows were typically required to wait a year, for that reason. Fortunately, there was no questionable pregnancy.
I found this article, which covers a lot of this ground.
While the primogeniture system is designed to be well-defined and unambiguous - “nothing more than an algorithm for inheritance”, as the article describes - the issue of posthumously-born heirs appears to be a grey area and one that has required further legal clarification. It appears from the article that, in the UK, when a new monarch ascends the throne, the Privy Council Office typically prepares the legal wording for the following accession.
The wording of Queen Victoria’s accession proclamation in 1837 said that Victoria would be Queen, but that if the wife of her predecessor, King William IV, gave birth to a child then that child would immediately succeed to the throne in her place.
It also appears that a regency for a monarch who is in the womb is not possible in the UK, unlike in the case of John I in France in 1316, as described upthread. In the UK a “regent must rule in the name of a monarch”.
The article describes three constitutional or legal options for dealing with children born posthumously to a monarch:
Devolve the Crown to the child in utero.
Devolve the Crown directly and permanently to the living heir presumptive.
A hybrid of options one and two. The Crown is devolved to the living heir presumptive, subject to the right of the posthumous child to oust the Sovereign off the throne upon its own birth.
This third option is the current status quo in the UK. The article points out that there would be a possibility for this to happen during the future reign of Prince George of Cambridge, Prince William’s firstborn. If he died while his wife were pregnant, then his younger sister Princess Charlotte would become temporary Queen until the child was born.