When Queen Elizabeth II became Queen on the death of her father, she was only able to do so because she had no brothers. (Otherwise, her eldest brother would have become King, under rules still in place today.)
What if, on that event, her mother happened to be pregnant with a boy? Would that boy be the King?
Possible follow-up question: What if the pregnancy is so new that the gender is unknown?
(I'm specifically interested in what happens under today's laws. I'm using Elizabeth II as an illustrative example. I don't think the laws have changed since then but I'm clarifying here in case they have.)