If two US carriers were attacked by a Japanese submarine, and there were no US destroyers present, the fighters on the carrier that got damaged would not be lost in the air. They would be stuck on the deck of the carrier until the carrier could get to a friendly naval base for repairs.
Since planes can not hit submarines without a friendly destroyer present, if a submarine attacks a carrier there is no reason for the planes to take off from the carrier. They would simply have to withstand the attack aboard the carrier like cargo on transports in hopes that the carrier’s own anti-sub defenses can get the sub or the sub breaks off the attack.
Therefore, you would not lose your planes if the carrier only took one hit.
However, say your carrier is next to a friendly island or coast and gets attacked by a pack of subs that gets two hits on that carrier. Then you would lose your planes even though they are just 1 space away because they never took off from the carrier because planes can’t hit submarines. That part sucks.