I had something similar happen to me once but with the help of the subsim community

I realised that it was because my sub had taken damage and even though I thought it was fully repaired my hull was weaker than when we left port. It didn't happen right away either it took several hours real time before she cracked open and started sinking