I felt dizzy earlier this week and I think the sooner you realize your feeling unwell the sooner you can get rest and recover (even if it does take a day).No one can get work done or learn when you feel like the room is spinning or feeling nauseous, so I say try not to feel like a failure and instead just realize and accept that you feel sick and do what you can to rest.
If you don’t schedule rest, your body will force it. Sounds like you needed the day off, being more intentional about it in the future can help not just to avoid like, missed class or unexcused absences but also just to rest better. Like you have more peace of mind when you aren’t telling yourself “I should be doing x instead”