This may be stretching the rope a bit too much.
D.Miguel I was the 3rd son, but 2nd surviving son of D.João VI.
When D.João VI died in 1826, he was legally succeeded by D.Pedro I Emperor of Brazil who abdicated the portuguese crown in his elder daughter D.Maria II da Glória.
D.Pedro established that D.Maria II would marry her uncle D.Miguel, a wedding by proxy was celebrated and they were formally married from 1826 till 1834 when the marriage was finally annulled.
D.Maria II was just 7 when she married her uncle
D.Miguel, the 2nd son, found himself legally married to the de jure Queen D.Maria II, although they never met during their "married life".
Wonder why it took so much time (8 years) to obtain the annullement of the marriage.
Of course D.Maria da Glória was a minor and there was no rush for her to marry anyone else, but considering D.Pedro saw D.Miguel as an usurper, he should have provided sooner for the annullement of that wedding.
May be he was too busy trying to regain the crown to be bothered with that "minor" circumstance .
I admit this one may be a stretch.
Heinrich V (1081 or 1086 -1125), was King of Germany (from 1099 to 1125) and Holy Roman Emperor (from 1111 to 1125) was the second son of Henry IV and his wife Bertha of Savoy (died in 1087).
Heinrich V married Matilda of England daughter and heir of King Henry I of England.
Although Stephen of Blois usurped the throne, during the ensuing Civil War known as the Anarchy, Matilda did capture London and Stephen was imprisoned. Matilda was never formally declared Queen of England, and was instead titled "Lady of the English" seating her coronation but in the end was unable to consolidate her position and Stephen returned to the throne and Matilda fled briefly to Normandy.
Also. The Anarchy did occur after the death of Heinrich V and Matilda's subsequent marriage to Geoffrey of Anjou.
Who were the royal princes born as second sons in their families and who married women who became heads of royal houses?
Probably the best-known example would be Prince Albert of Saxe-Coburg and Gotha, who in 1840 married his first cousin, Queen Victoria of Great Britain.
Their kinsman, Prince Gaston of Orléans, married Isabel, the Princess Imperial of Brazil
Prince George of Denmark (1653-1708) was born the third son in his family (his father being King Frederik III); but because one of his older brothers died in infancy, he might count as a second son. In any case, he was married to Queen Anne of Great Britain.
Are there other examples? What about the early pre-Spanish kingdoms or Navarre?