Think bigger picture. A sub that actually sank a carrier (as opposed to war games) might get away inscathed but the country that ordered it wouldn't. You might be able to hurt an enemy with dramatically greater resources and meet and negotiated objective, but you can't enrage them. Pearl Harbor being the classic example.
Completely agree.
My point is a sub can sink a carrier or other ship, general pratice if a sub sinks ANY SHIP it becomes traget number 1 for the rest of fleet, and then get away from the fleet.
Using WWII as an example look at the number of ships sunk by subs compared to subs sunk. It was to the point that US and Britain largely focused on combating the sub threat by attacking the fuel source so the germans couldn't operate them, along with tanks planes etc.