Not at all, the role of a submarine is to avoid the destroyers to target the CV.
Unless it is an American submarine in the Pacific. Sinking destroyers was one of the top priorities of US submarines, as the Japanese had few escorts and was completely overtaxing their destroyers to pull merchant marine escort duty, fast-transport duty, surface fleet escort duty, and also occasionally do the actual combat missions they were designed to be so oversized for.
The US submarine fleet actually managed to sink 1/3rd of the front-line destroyers the IJN possessed (and another roughly 40% was sunk by air power, with everything else - including accidental ramming and friendly fire as well as normal surface ships shooting them - taking up the last third)... and that's with the worst torpedo in the War ruining their chances for the first third of the war.
That said, while you might think of the worst threat to carriers being other carriers, but that was only true for the Pacific. There was a 12-9 split for carriers sunk by aircraft to submarines for the Japanese, and a 7-3 split for the Americans, plus Gambier Bay getting left undefended against a surface fleet by Hallsey. The British lost 5 carriers to U-boats, one to aircraft (in the Pacific), and one to being too dumb to run away when the Scharnhorst came rushing in, guns blazing.
Carriers (especially seaplane tenders) are useful for spotting submarines on the surface and providing warning or even attacking before they have a chance to dive (and even making the submarine dive is a minor win, as WW2-era subs could only move 1/3rd their normal speed submerged, and needed to recharge their batteries on the surface, so a sub submerged is a sub that can't move into position to attack your convoys as you re-route them away). That said, carriers are by far the juiciest targets for a submarine to attack, as they're positively huge, expensive, powerful, but very, very vulnerable to torpedoes thanks to the self-sabotage of the Washington and London naval treaty weight caps.