Ship sinking credit can be very squirrelly - kind of like Eichhörnchen...
anyway, what can happen, especially up inside the Inland Sea, is that a ship cannot "fully" sink and reach its "crush" depth, which is when it is 'finished' sinking and is then "destroyed". You have to "destroy" the unit completely, which can also be accomplished by hitting one of its magazines. Also, if the ship is "in the process" of sinking, and you then leave the visible "spawn" area, which is roughly 8-12nm, you might not get the credit either, in spite of seeing a ship-sunk icon. Another factor is that something else contributed to the sinking, such as a storm, and that is what actually pushed the "damage" amount over the top, and is what is then credited with the ship sinking, and not the player, that put the torpedoes into it. As BH mentions, it happened in real life also...