I had the same thing happen to me when I went to Maui, I switched my normal snorkel tube for one that had a cut-off valve to stop water from coming it.  After swimming to the bottom and returning to the surface for air, the air would not come in and I felt like I was drowning, which of course causes panic.  After this happened a couple of times, I swam to shore switched back to my normal snorkel tube.