Looking at James Cameron’s sub he had a safety mechanism where seawater would corrode the ballast if the ballast failed to mechanically be dropped and it would drop ballast on power loss.
So in that system as long as nothing is above you you have normal operation, a fail safe system and a secondary fail safe. This sub in one of the articles talks about 7 ways to service but never discussed them.
https://en.m.wikipedia.org/wiki/Deepsea_Challenger
Also this one seems way better too
https://en.m.wikipedia.org/wiki/DSV_Limiting_Factor