Ferdinand
really disliked his daughter's husband, Philip the Fair. Their arrival in Castile was problematic and Ferdinand frequently quarrled with Philip. (Most likely, he was upset because his daughter was mentally ill and it meant that Philip, as her husband, would rule Castile, and not he). A civil war nearly erupted IIRC, but Philip's untimely death smoothed things over.
However, Ferdinand was pretty much eager to ensure Philip (and his progeny) didn't inherit Aragon, and promptly sought out a new wife and persued and a pro-French policy. He married Germaine de Foix and although she did become pregnant and bear a son, he died shortly after birth. If Ferdinand gets lucky, perhaps the little Prince of Girona (named Juan if I recall) survives.
That will end the personal union between Aragon and Castile. Isabella II and Philip inherited Castile from Isabella I because she was the eldest surviving child, her brother Juan having died in 1498. Philip and Isabella would have no claim over Aragon, as while the Cortes had proclaimed her heiress at some point after 1498, Aragon pretty much followed a semi-salic succession: a woman could succeed, but only if there were no males left to do so. The birth little Juan knocks Isabella down to second in succession.
Another idea might be a Tudor wedding for Ferdinand. He was still haggling with the miserly Henry VII to hurry up and set a date so his daughter Catherine could marry Henry VIII, but the old king was being stingy regarding the dowry. Shortly after the death of his Queen, Elizabeth of York though, he was briefly considering remarriage, as his only remaining live son was Henry VIII, who Henry VII apperently didn't have much faith in. There were apparently several considerations at hand, although it may be hear say.
One is that Henry VII was considering marrying Catherine
himself. Another was that Henry was interested in
Joanna of Naples. The report on her appearance was satisfactory, but the marriage failed due to unmentioned political and financial reasons. Most likely because of the sour relations that existed between Ferdinand of Aragon and Henry VII (Naples was independent, but ruled by a branch of the Aragonese Trastamara) and probably the fact of the raging Italian wars and the Trastamaras of Naples were far from secure on their throne. Financially, they were probably unable to offer a dowry that the miser Henfy VII would be satisfied with.
The reason I bring it up, is that perhaps instead of Ferdinand marrying Germaine of Foix (and getting tangled up in French affairs in Italy), he makes an offer for Mary Tudor (that is, Henry VII's daughter who married Louis XII, not
Bloody Mary) and in return agrees to help secure a match between Henry VII and Joanna. It gives not only Ferdinand a chance of progeny (he was obviously still fertile given Germaine's pregnancy, and Mary produced children with Charles Brandon), but it also gives Henry VII a chance for another son or two, "spares" so to speak for the Tudor dynasty. It might also help if there are stipulations to resolve the financial squabbles between Henry VII and Ferdinand -- say Henry VII dropping claims regarding Catherine's dowry and setting a date for her to marry the Prince of Wales, and Ferdinand offering an additional sum to whatever the King of Naples offers as a dowry.
https://en.wikipedia.org/wiki/Joanna_of_Naples_(1478–1518)