I experience the very same thing if my sleeping pattern gets disturbed.
I'll be knackered and on the verge of nodding off through the day, then I get to bed and fall to sleep straight away and 20mins later I wake up and I'm wide awake but still knackered. I reckon it's the brain getting used...