Having worked in the scuba industry from levels ranging from DM to captain, I can say most of the near misses with injuries and panic attacks have occurred at the surface. Especially with boat dives, where getting back on the vessel in any sort of sea state presents numerous challenges.
I attribute these near misses to complacency (thinking the dive is over) and not following directions. When divers hit the surface and get in the mindset that the dive is over, they tend to forget the basics of establishing positive buoyancy and maintaining a way to breathe. Can't express how many times a diver hits the surface, immediately pops out their second stage, and begins to sink back underwater without an air source. Similarly, not following crew instructions and either turning their back to the rocking boat, approaching swinging ladders without being ready to board the vessel, and finding themselves directly under another diver who is climbing have lead to some real hairy situations.
I always try to reiterate to divers on my boats that the dive is not over until you are back in your seat. Then, it is safe to relax and talk about how the dive went.