This literary device (the guest moves the cradle; Mom, using it to find her way in the dark, ends up in the wrong bed) was very popular in the Medieval literature.
Jean Bodel, Gombert and the two Clerks:
Then Sir Gombert got up;
Stark naked, he went out the door to piss.
The other clerk came to his bed,
Right from in front of the headboard
He took away the cradle with the baby
And carried it to the bed where he lay.
Now Dan Gombert is tricked,
For he always had the habit
At night when he came back from pissing
That he would first grope for the cradle.
Thus, as was his custom,
Sir Gombert soon came groping
To his bed, but there was no cradle there;
When he did not find the cradle,
Then he felt like a real fool.
He supposed indeed that he had lost his way.
"The devil," he said, "afflicts me,
For my guests are sleeping in this bed!"
He came alongside the other bed,
And he found there the cradle and the baby.
Chaucer, The Reeve's Tale:
And up he roos and softely he wente
Un-to the cradel, and in his hand it hente,
And baar it softe un-to his beddes feet.
Sone after this the wyf hir routing leet,
And gan awake, and wente hir out to pisse,
And cam agayn, and gan hir cradel misse,
And groped heer and ther, but she fond noon.
'Allas!' quod she, 'I hadde almost misgoon;
I hadde almost gon to the clerkes bed.
By, benedicite! thanne hadde I foule y-sped:'
At the same time Adriano, not by reason of the noise, which he heeded not, but perchance to answer the call of nature, also got up, and questing about for a convenient place, came upon the cradle beside the good woman's bed; and not being able otherwise to go by, took it up, and set it beside his own bed, and when he had accomplished his purpose, went back, and giving never a thought to the cradle got him to bed. The good woman searched until she found that the accident was no such matter as she had supposed; so without troubling to strike a light to investigate it further, she reproved the cat, and returned to the room, and groped her way straight to the bed in which her husband lay asleep; but not finding the cradle there, quoth she to herself:—Alas! blunderer that I am, what was I about? God's faith! I was going straight to the guests' bed; and proceeding a little further, she found the cradle, and laid herself down by Adriano in the bed that was beside it, taking Adriano for her husband; and Adriano, who was still awake, received her with all due benignity, and tackled her more than once to her no small delight.
and many other authors used that trope.