How about this one.
Mary of Burgundy is a boy. Let's call him Philip. Philip marries Kunigunde, Frederick III's daughter, instead of her marrying Albert of Bavaria.
Maximilian then suddenly falls off his horse before he could marry anyone else.
That leaves Frederick III with no male heir. So like Sigismund before him, he names his son in law as successor. He also had him crowned King of the Romans (which there wasn't much opposition since at the time, he was pretty far in line with the French succession).
When Frederick III dies, Philip by right of his wife becomes Archduke of Austria, and of course, became Emperor-elect.
Philip of course, already holds Burgundy and the Netherlands.
Let's say Charles of Angouleme only had daughters.
Now Charles VIII's son Charles Orland survives and becomes Charles IX of France. He also has a younger brother Louis. But later, the younger brother Louis died.
Then in 1513, Charles IX dies of illness before he could get married. Louis Duke of Orleans becomes king Louis XII. He has a son named Philip, who becomes dauphin.
Then suddenly, the dauphin dies, and Louis XII marries, but he dies before his child was born. When it was born, it was a daughter.
Who is next in line? Well, it's Emperor Philip II (Philip I was Philip of Swabia), son of Charles of Bold, Archduke of Austria, Duke of Burgundy, Holy Roman Emperor.
So there you have it. Philip II and VII, king of France, and Holy Roman Emperor.