While the fast of a fasting person who spends most of their day sleeping is valid, it is a kind of negligence on their part - especially since the month of Ramadhan is a special time for us to focus on our worship to Allah S.W.T.
This blessed month, us Muslims should strive to benefit from the month by reading the Quran a great deal, seeking provision and acquiring knowledge, while doing good deeds with the right intentions.
Many scholars have advised on making the most of our time during the holy month and to not waste it sleeping.
There is nothing wrong with sleeping during the day or night, as long as it does not lead to missing out on any of the obligatory duties or committing any haram actions.
However oversleeping in this month can make one lazy from performing acts of obedience and worship. It may also cause one to miss congregation prayers.
Let’s try our best - especially in these final nights of Ramadhan - to avoid being distracted from our acts of worship by sleep or anything else.