If Isabella of Aragon is born male, in this time he is called as Juan, he can marry Juana La Beltraneja instead of Alfonso V of Portugal, solving the Castilian succession issue.
In this scenario, they don’t need to think about that much..So Isabella & Ferdinan either:
a) marry their oldest son and heir to bastard.
or
b) acknowledge la Beltraneja as rightful heir of Castilian throne