Solar Eclipses, Lunar Events, Blood Moons, and Goblin Army invasions cannot be slept through; you are also unable to sleep if there is currently an Enchanted Sundial active in the world.