In the Star trek universe, the Klingon Bird of Prey was hit by photon torpedoes, did two timewarps and kept running, but when dipped into seawater promptly sank.
Why should this be a "problem" or "discontinuity" or a "shortcoming" or whatnot? It makes sense that starships would be denser than water (say, the mass figures quoted by Scotty and Janeway for their respective ships would certainly dictate that).
The BoP sinks, just as it should, but this in itself is not a problem for our heroes. Their problem is that the vessel has lost all power, meaning it would be pretty stupid to sink with it. So they blow a hatch to effect their own escape, and Kirk then struggles to help the whales out, too.
The alternative would have been not to blow any hatches, which would have been fine until the air grew stale and the heroes and the whales suffocated. Of course, the rest of the planet would have come to their rescue before that happened, but they couldn't really count on it, especially as it would have delayed releasing the whales and thus saving that planet. They were in a hurry of sorts.
Timo Saloniemi