When you're sleep-deprived, your cortisol levels, which are naturally linked to your body's wakefulness, may become elevated, giving you a temporary "energy boost". This, paired with your tendency to compare how you feel today to how you felt yesterday, can create the illusion of feeling better.
In cases of extreme sleep deprivation the body can shut down extra functions to conserve energy and focus on specific task, which can feel like increased focus and productivity.