Simple idea if you don't go to bed for long enough you'll start to get debuffs and ultimately pass out. So once a planet day your rest bar should be almost gone.