Meanwhile I saw it three times in a big village with a lots of villagers: In the night Villager move around the village in sleeping position. The sleeping position didn't change if they change there moving direction / Use stairs etc. It seem that the try to reach the bed they are started the "walk". In the morning they stand up (maybe teleporting to the bed in that they are "sleeping") and everything is ok.
Please check if this is still an issue for you in 1.16 Release Candidate 1 or later.