Your brain does creative work better when you’re tired.
This Scientific American article explains how distractions can actually be a good thing for creative thinking:
Insight problems involve thinking outside the box. This is where susceptibility to “distraction” can be of benefit. At off-peak times we are less focused, and may consider a broader range of information. This wider scope gives us access to more alternatives and diverse interpretations, thus fostering innovation and insight.