Skeletons riding an undead mount cannot pathfind correctly underwater causing them to swim in one direction, making them incapable of pursuing the player. Use the following command to summon a skeleton horse trap:
/summon skeleton_horse ~ ~ ~ {SkeletonTrap:1}
Other than the ridiculously high speed, the skeletons on the horse swim in a random direction away from the player.
Can confirm in 21w05b.