In a single player world, try commands like
/execute @p ~ ~ ~ spawnpoint
or
/execute @p ~ ~ ~ setworldspawn
or these two
summon Pig ~ ~ ~ {CustomName:Piggy}
/execute @p ~ ~ ~ spreadplayers ~ ~ 0 1 false @e[name=Piggy]
Expected: the various execute commands succeed, and set the player's spawn point, or set the world spawn, or spread the pig, relative to the player.
Actual: command fails with an error message.
Use
/execute @p ~ ~ ~ spawnpoint @p
or/execute @p ~ ~ ~ spawnpoint @p ~ ~ ~
/execute @p ~ ~ ~ setworldspawn ~ ~ ~
spreadplayers
cannot take relative coordinates, must use absolute values.