Time in bed and restorative sleep are not always the same thing.
Interrupted sleep, an irregular routine, stress, medicines or a health condition can leave you unrefreshed; a sleep diary can help you spot patterns.
General information; not a diagnosis or a substitute for professional advice.
A little more context
An irregular schedule, repeated awakenings, medicines, stress, or a health condition can contribute to feeling unrefreshed. A vivid dream by itself does not identify the cause. Keep a simple record of sleep and wake times, awakenings, and daytime sleepiness. Persistent symptoms deserve a conversation with a healthcare professional; mention gasping, loud snoring, or observed breathing pauses. A comfortable room can help you rest, but a mattress or sleep app should not replace assessment of possible breathing problems.