This is a documented bug in SH3
it occurs when you crash dive but don't allow the manouver to complete.
When you order a crash dive you have to let the sub dive to 80 metres when it will automatically level out. If you interupt this manouver by setting another depth before the levelling off then you get the behaviour you describe.