To reproduce, place a bed so that the pillow section is outside the world border, click on it to see the message in chat that says "Respawn point set", and then die to respawn outside the world border. You can also sleep in it to go outside the world border. Expected is that spawn points are obstructed whenever they're outside the world border.
Related issues
is duplicated by
relates to
Attachments
Comments

Another thing I have discovered is that no matter how high you set the spawnRadius, you never spawn outside the world border (as expected), so it is also expected that you shouldn't be able to have a spawnpoint outside the border.

Does this also affect chests outside of the world border?
Can confirm in 21w05b.
Can confirm in 21w06a.
Can confirm in 21w07a.
This issue has been fixed in 1.18 Pre-release 1.