Anyone who owns a bed most likely knows about this horrendous crime against our pockets, it must be fixed.
Its a simple bug, if you log in while sleeping in a bed, you'll appear in the center of the bed, and if for some reason you log out or crash while standing in the center of the bed your next login will be at your leanto with all of your inventory dumped out.
Now, anyone who owns a house with a bed inside likely has the bed against the wall, and if your inventory gets dumped, half of it will go into the walls.. effectively lost forever.
The simple fix for this is to make beds Nocliped, like leantos. If you log out while standing in the middle of a bed, you'll still be moved to your leanto(or perhaps the bed?), but your inventory will not be lost just like logging out on top of your leanto.