On Shavuot eve, we have a custom of staying up all night to study Torah, to make amends because, when the Israelites were about to receive the Torah at dawn, they were sleeping, and God had to awaken them with thunder and lightning. The Midrash [Song of Songs Rabbah 1:12] even says that God taunted them through the mouth of Isaiah, saying:
Why is it that when I came, no man was there; when I called, no one was there to answer? [Is. 50:2]
This is not in the Torah. The Torah [Ex. 19:16] only says it happened "בִּֽהְיֹ֣תהַבֹּ֗קֶר -- When morning came into being", i.e. at dawn. Why shouldn't the Israelites be sleeping as dawn breaks?