To reproduce the bug, you can move the player from left to right and from right to left (see video).
Note: This does not happen in Minecraft 1.21.1, it seems to be a bug in Minecraft 24w34a.
To test the bug, the easiest way is to use the world file provided in the zip file.
Can confirm: