I can't say I agree with this sentiment or working on a side project during work hours. Too many IP ownership questions for my liking.
I have to ask, why does your day job need to suffer? Maybe if you're trying to have a life you're letting your job slip showing up hungover, I'm kind of ok about that. But I'm more concerned for your wellbeing as it shouldn't require any real suffering and under performing at work is probably a sign of getting overwhelmed, it will eventually leak into your side project too, so sort out why and do what you can to fix it. Step back hours on both if you have to.