I don't need to mention those sovereigns who had acquired thrones through conquest (e.g. William of Normandy, Henry VII Tudor, Napoleon). One needs only to look to none other than Victoria's own ancestor, the Electress Sophia of Hanover, who I believe was born only 48th in line to the British throne, on the basis of genealogy alone.
But in the wake of the 1688 Glorious Revolution and the 1701 Act of Settlement (which displaced all the eligible Catholics who were ahead of her, as well as some Protestants who were of doubtful legitimacy), she moved all the way up to 2nd place (the future Queen Anne was heiress presumptive from 1688 to 1694, and heiress apparent from 1694 to her own accession in 1702). Sophia was, in fact, heiress presumptive to her Stuart kinswoman for nearly her entire reign, predeceasing her by only two months. As such, she came tantalizingly close to becoming queen regnant.
I was wondering about other cases of royals who were born low in the succession, who never expected to inherit and never did, but nevertheless came tantalizingly close -- thanks to fate and chance. Indeed, the said Act may very well be argued to be the greatest fluke factor impacting succession in royal history -- considering the number of persons removed from the line to a throne simply because of religion.
I am led to think of the shenanigans later on of the sons of King George III (who, like his grandfather and great-grandfather, had succeeded to the British throne as the heir-general to the Electress). Consider, for one, Prince Ernest Augustus, the Duke of Cumberland: as the fifth son born to a reigning monarch, he was fifth in line to the throne at the time (1771). He retained that position until displaced in the succession by the birth in 1796 of his niece, Princess Charlotte of Wales, when he moved to sixth place: that was the first change.
Then in 1817 she died tragically of complications involving childbirth, and the Duke of Cumberland moved back up to 5th (the second change). A trio of marriages involving his brothers took place the following year, and a daughter (the future Queen Victoria) was born in 1819 to Prince Edward, Duke of Kent, fourth son of King George III. So he was once again displaced to 6th place (the third change).
Eight months later, the said duke and his father died within a week of each other. The Duke of Cumberland would have moved back up to 5th place (the fourth change) and 4th place (the fifth change), during January of 1820.
Later that year, a daughter (Princess Elizabeth Georgina) was born to his brother William, the Duke of Clarence, third son of King George III. So the Duke of Cumberland got displaced to 5th place (the sixth change). He moved back to 4th place three months later, when his niece died (the seventh change). Then in 1827, his childless second brother (the Duke of York, estranged from his wife, born a princess of Prussia) died, and the Duke of Cumberland moved to 3rd place (the eighth change). Three years later, the divorced and childless King George IV died, moving him to 2nd place (the ninth change). Then in 1837, King William IV died with any surviving legitimate child, meaning that their niece Victoria came to the throne as queen regnant (taking the place of her long-deceased father, who would have become King Edward VIII had he lived). That was the tenth change, which actually moved him to FIRST in line to the throne, making the Duke of Cumberland heir presumptive.
This, of course, was the closest he ever came to the British throne, which he never acquired. For over the years, he got increasingly displaced in the succession by children born to his niece, who managed to survive nine childbirths, as opposed to dying in childbirth like her cousin Charlotte. As it was, the first seven children of Queen Victoria were all born within the lifetime of her uncle Ernest. Each birth, of course, changed his position in the British succession; so all in all, his position changed SEVENTEEN times throughout his 80-year life. But although he never became king of Great Britain, he nevertheless became King of Hanover.
Another notable royal coming to mind, whose place in a succession changed numerous times throughout his long life, would be Prince Luitpold of Bavaria (1821-1912), third son of King Ludwig I, who would eventually be named regent of the kingdom on behalf of his mentally incapacitated nephews. I believe his position changed seven times: this was nowhere near the same number of changes undergone by his distant British kinsman, the Duke of Cumberland. Still, it attests to the fluke factor impacting succession.
For at birth, Luitpold was fourth in line to the Bavarian throne, behind his father (the then-crown prince), his oldest brother (the future King Maximilian II), and second brother (the future King Otto of Greece). Four years later, his grandfather (King Maximilian I) died, making his father into the new king (Ludwig I), and himself third in line to the throne: that was the first change.
Then in 1832, his second brother (Prince Otto) renounced his rights to the Bavarian throne in order to accept the Greek -- I believe. Prince Luitpold would then have moved to second place: that was the second change.
The birth of a son and heir (the future King Ludwig II) in 1845 to his oldest brother (still crown prince) displaced him to third place (the third change). Then in 1848, his father (King Ludwig I) abdicated in disgrace over the scandalous affair with the notorious Lola Montez, and his oldest brother succeeded to the throne. So Prince Luitpold moved back up to second place (the fourth change).
A month later, a second son (the future King Otto of Bavaria) was born to the newly ascended King Maximilian II. So once again, Luitpold was displaced to third place (the fifth change). This would, in fact, be the last time he would get displaced in the Bavarian succession, since neither of the two sons of his oldest brother ever married or had any children.
The elder one, of course, succeeded as the infamous "Mad" King Ludwig II in 1864, after the unexpected illness and death of his father. Luitpold then moved up to second place (the sixth change), a position he would retain throughout the entire 22-year reign of his nephew.
He moved up one notch after the death of the said nephew, a week after getting deposed in a coup d'Útat (the seventh and last change). Luitpold was now first in line to the Bavarian throne -- heir presumptive to his other nephew, Otto (who reigned as king in name only, as he was deemed too mentally unfit to rule). It was a position he retained for the remaining 26 years of his life.
But although he never succeeded, Luitpold was the DE FACTO king of Bavaria, since a regent exercises all the constitutional powers of a sovereign. So he, too, would count as an example of a royal whose position changed numerous times in a succession, and came tantalizingly close to the throne -- and who, in a sense, acquired it (except in name).
His situation was obviously different from that of the Duke of Cumberland, who (for only four years) was first in the line of succession to the British throne -- a throne he never acquired in any way, as regent or otherwise. As it was, he had to content himself with the consolation prize of succeeding to another kingdom, in Germany ...
Any other examples of heirs who came close to succeeding, having had their positions changed numerous times?