The order does matter! The carpet unlocks the bed, the hitbox for the bed is on top.
I did that for a quick solution to the issue of the player being inundated with text boxes, I might change it going forward because you're the second person I've seen struggle with that specific item. At the very least, I can move the bed's hitbox to be easier to find.
Thank you so much for playing!