Hm actually I don't think it's a glitch. Planes strafing with theirguns can damage you, pt boats machine guns can damage you and armed merchants with machine guns can damage you. Remember it's not a battleship it's a uboat (boat

) it's lightly armored small and it's main weapon is it's stealthiness and ability to hide from gunfire not sustain it. Though I would probably do the same thing as you I would recommend getting out of it's range and shoot it from afar with deck gun.
Happy hunting