The credit goes to Stefan over in Aragon for that turnaround. I was ready to bow out thanks to my spectacular fuck-up, but he came to my rescue like a knight in shining brown armour.
edit: To clarify what happened. I declared war for my core as Portugal's only ally was a busy England, mid war Portugal managed to ally, then a few months later call Castile into the war. I got a stack of pretender rebels spawn that I only just beat, whilst that was happening I wasn't able to intercept troops from landing, end for me. Until Castile white peaced, and Stefan came sailing in.