My villagers tend to go swimming, but some stay out there because they are "trapped" in the seaweed. They think they're stuck in a full block & decide not to move, yet they are still able to stay above water & bob around.
I don't know if this includes other mobs, and/or if other water-based/water-logged blocks carry the same effect.
Attached is the example of a villager getting trapped.
Related issues
Attachments
Comments

[media]
Duplicate of MC-136318