When you jump from a height great enough to take damage on falling on a bed, the damage is taken after you leave the bed, not when the player comes in contact with the bed. I found out this bug when I was lazy, so I jumped into a ravine that contained my "open air" base and onto my bed. I did not take any damage when I slept on the bed but almost died when my player woke up.
WAI, this is a way to delay fall damage