Submarine operations are always potentially dangerous, in peace and war. In war even a sub’s own torpedoes can be its own worst enemy.
The problem plagued US Mark 14 and Mark 18, 21 inch torpedoes used by the US in WW2, could be programmed by a submarine to go on a circular course for part of the torpedoe's run. Problem was the gyro mechanism, supposed to ensure safety, was insufficient to prevent some torpedoes completing a totally circular run – which could hit the parent submarine. Hence the tale of USS Tullibee.
USS Tullibee has a short but fruitful career during her first 3 war patrols, 1943-1944, sinking several Japanese ships.
On her fourth patrol, on March 26, 1945, off the Palau Islands, Tullibee made radar contact on a six ship Japanese convoy. Tullibee closed to 3,000 yards of the convoy and launched two torpedoes. About two minutes later Tullibee was shaken by a violent explosion. It was only learned after the war that one of Tullibee's Mark 14 or Mark 18 torpedoes (there is debate what type(s) she fired that day) had run a circular course and sunk Tullibee.
------------------------
Gunner's Mate Clifford W. Kuykendall, on top of bridge at the time, was knocked unconscious and thrown into the water. Only his life-preserver saved him. When he regained consciousness, he saw Tullibee rapidly sinking. Kuykendall heard voices in the water for about ten minutes before they stopped. The next day, he was picked up by Japanese destroyer Wakatake.
Japan's Wakatake-class destroyers were succeeded by the Kamikaze-class destroyers, would you believe. The first of class, named Kamikaze (of course) was launched in 1922, long before the "war winning" Kamikaze strategy became trendy.
Clifford W. Kuykendall survived being a prisoner of war and was released after V-J Day.
Here and below is a 2014 video of Tullibee survivor, Clifford W. Kuykendall, from Wichita, Texas, recalling the tragic last few minutes of the Tullibee.
See more about USS Tullibee here and here (scrolling one quarter down) including more details about Clifford W. Kuykendall's survival in spite of Japanese "hospitality".