Alternatively, she does take the hit, but damage control is started promptly - in OTL, Captain Maund decided to evacuate the ship to avoid severe loss of life should the Ark Royal sink rapidly. Effective DC early might have been enough to save the ship, but she's out of the war until repairs are complete.
If she can be stabilized, and towed to Gibraltar, the damage to Ark Royal shouldn't be too massive. It was a single torpedo hit that missed magazines, caused no fires or secondary explosions,
https://en.wikipedia.org/wiki/HMS_Ark_Royal_(91)#Investigation
Ark Royal sank 30 nautical miles from Gibraltar. Keep the crew onboard to complete emergency repairs, and then there are seven destroyers and the Dido class CL Hermione that can tow the carrier to Gibraltar. At five to eight knots this would take about 6-7 hours.
I'd see emergency repairs in Gibraltar, then Ark runs for Norfolk, VA for extended repairs and modifications. For starters, scrap the double level lifts, flatten out the aft hull rundown, and install secondary power. You can see the aft rundown or round down below - flatten this out and widen it to full width, and you gain a lot of deck space.