That's your mind just being overactive. It's overtired and needs a break. Try to control your anxiety more during the day by keeping your mind off yourself and those thoughts should go away or at least become less frequent. You're not going crazy, you need to get some sleep.
The only thing that's different with mine is that I usually have the thoughts before I fall asleep instead of when I wake up in the middle of the night. You'll be OK in no time