Tested in single player, that if you right click on a bed to sleep, your arm stays in the position it had halfway through the animation. Able to replicate it by lagging the server to +50ms ticks spawning villagers. It happened 1/5th of the time.
Environment
Villagers in surrounding chunks lagging the server to 50ms
Duplicates MC-96880