This has happened to me consistently for the past 6 months. I play on PS4 with no add ons, no cheats, just normal gameplay. I got over it old world but created new world for 1.17, and same issue.
The command I am using to test this is "/spreadplayers ~ ~ 0 50 false @p", this is being run from a command block in the middle of the ocean, with nothing but water directly below the sky.
Edit: One quick thing to note, kelp stalks, when grown to the surface of the water, count as valid spots to place a player. So to reproduce this in the ocean correctly, make sure there is no kelp contacting the surface of the water in the area the /spreadplayers command is checking.
Is there a version of this bug that isn’t “resolved”? Because it’s pretty detrimental to gameplay and has been around for a while.