I think it can happen so it probably has happened somewhere some time, but I've never heard of one. Fundamentally, the loss of a boat due to sinking is the key, not any electrocution hazard. If a boat sinks in the ocean with sharks around, it matters less that there is electricity than that there are sharks and no boat.
An electric boat can have a lot of current capacity in its battery. We are not talking about a standard car battery in a small pleasure craft, but potentially batteries in electric propulsion systems of up to, say, 30 foot boats (larger boats would have more extensive counter measures and safety measures). As I understand things (correct me if need be), for there to be a serious hazard in a sinking (about the same as a shark attack), some conditions have to be met.
* Fresh water, not salt water. Sharks and animals that would prey on humans are only in salt water (disregarding special cases like pirhanas). Salt water is an excellent conductor of electricity, so it flows preferentially around the body. In fresh water, the body is a better conductor, so some portion would flow through the body, but that would involve only a small fraction of the electric field. In fresh water, it has to travel through a lot of low-conductivity water before it gets to the body.
* Sharks don't tend to follow boats unless operators are careless about throwing chum and guts into the water.
* No fault interrupter in the battery or the battery is not sealed. Tiny sealing failures would only allow a tiny current out because they would be tiny compared to the battery terminals which must carry much more current. I think (I don't know) proper battery design and manufacture would include a fault interrupter so that if current exceeds limits it get shut down. Like a last resort fuse.
* Nearness to boat: Needed distance increases with current. Not much field beyond 15 feet but would be larger for propulsive systems. Being "near" would mostly give tingling sensations or interfere to some extent with muscle activity.
* Jumping into the water and not a lifeboat.
* Leaving the boat late in the sinking after water has entered the battery compartment.
For electrocution to occur, there has to be sufficient current (measured in milli-Amperes). Anything that minimizes the current helps.
Regardless, don't swim in marinas near boats. Besides icky fuel sheens on water, there is a hazard with faulty boats and faulty electrical connections to the docks.