The book describes the passage being opened by the death of the shark. There are many ways the encounter could reasonably end without the shark dying. It's a flaw. The shark could be taken out with a sleep spell, or pacified by magic, etc.
The writers describe the rivals claiming the jewel if the players refuse to touch it or if the rivals kill the shark and get in there first, but as written the story would dead-end if the adventurers, say, charm the shark or just take the prize off it and leave - or even if they lure it into another area and kill it there, which they can potentially do even before the rivals reach the final area.
The DM can fix it, but even a casual read will spot the problem.