1. Go to the worldborder and place a bed with the long side next to it. engulf the open sides of the bed with stone. build a tunnel that leads below the bed.
2. Sleep in the bed. If the setup is right, you should wake up one block inside the worldborder.
3. Get out of there and kill yourself. You should respawn on top of the worldborder at height 256.
Relates to, if not even duplicates MC-64544