Also I can sleep when I take away a piece of carpet
So I recreated the issue. If you place a bed in the corner of house with 2 block high wall and carpet all over the ground it should tell you that the bed is obstructed.
Also I can sleep when I take away a piece of carpet