Narrated Ali ibn Shayban: The Prophet ﷺ said: If anyone spends the night on the roof of a house with no stone palisade, Allah's responsibility to guard him no longer applies.
Hadith Referenceسنن ابي داود / أبواب النوم / 5041
Hadith Gradingالألبانی:صحيح | زبیر علی زئی:حسن, مشكوة المصابيح (4720), وله شاھد عند أحمد (5/79، 271 وسنده حسن، زھير بن عبد الله حسن الحديث)
Benefits and Issues: ➊ That is, in such a situation, if he falls and perishes, or suffers harm, then he himself is responsible for it. And it is not permissible to sleep on such an exposed roof.
➋ The scope of Shariah is not limited only to prayer, fasting, Hajj, zakah, or the mosque; rather, it encompasses the entire life of a Muslim.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 5041