Someone said this works similarly to Breath of the Wild swimming where if you run out of stamina into the water you faint, except in BoW you are teleported to the closest shore, and in Valheim you just die.
Better yet, if you were running and the last notch of your stamina gauge was spend entering the water you will slowly die 1 foot from land, because you can't move at all once your stamina is gone and it doesn't recover either as long as you are in the water.
I guess that's why Vikings developed boats, going into the water is a no-no.. still very brave of them knowing they would pretty much die if they feel off a boat.