Disoriented
The OP admitted that they were a certified diver, albeit an inexperienced one. As we already know, a lack of experience and a yearning to go underwater can lead to pretty scary results. And the OP’s experience was no exception. While descending, the OP wound up staring at a wall of colorful coral.
While that might not sound too threatening, it’s important to note that the explosion of color can be enough to disorient anyone, the OP included. That’s what happened, and they had no idea which way was up. Even though coral are harmless (we think?), we would also be freaked out by a sudden explosion of color.