Please acquire a set of paper charts AND MAINTAIN A RUNNING PLOT ON THEM.
Remember it is not IF a piece of electronic equipement will fail but WHEN.
Also lightning strikes, flat batteries and the GPS system can go off, all mean that you are clueless to your position.
You didn't say how much "outside" experience yuo have, but If you "just missed the reef" you used up a WHOLE lot of your luck inventory. "Sea grass"?, Eel grass or kelp? If kelp, it can signify that you are getting into shallower water. As above, use your charts and improve your chances of staying alive, just a thought