In my opinion you engaged from a too short distance.
When I engaged an aircraft carrier, I fired from about 6 to 7km. The target is big enough
The trick is to fire a full spread of torpedoes that almost covers the length of the target. That way even if you miss by a little, still 3 torps should hit the target. Usually enough to seal its fate.
as soon as you fire, you get the hell away from where you were, because the escorts will go down the bubble trail. If you are far away you can dive at a fast speed. That helps.