It could mean that you have some demons in your closest that you may should not be casting spells for sometime until you get it cleared up. Kinda like "The Secret," when your in a good mood then you get things done better and get the things you want and when your in a bad mood you get bad things done because your thinking of those bad things.
If you need to burn some Sage or take a bath.
P.s. when I say demons it is my phase of bad things even tho not all demons are bad.
Based only on what you have told I came up with these possibilities:
1) a food substance (as Barbarious said), this doesn't mean you are crazy. It means a certain chemical affected your brain similar to how an allergic reaction would affect the body; it messed it up temporarily. Other then caffeine (and I haven't heard of such a serious case from caffeine), red 40, red 4, and yellow 5 food colorings have also caused problems for people.
2) a new medication could have affected you the same way any other food substance might have. It could be a side affect.
3) some kind of spirit or demon. I know how to deal with either if you'd like to know that.
4) if you have had a violent past this could be caused by things that you've been through.
and 5) if you lacked food, drink, or sleep, your mind may have responded from the lack of requirements. It needs nutrition from food, it needs water, and it needs sleep. If it lacks any of those then certain parts will shut down and cause you to see/hear things and also give you strange dreams or, when you close your eyes, images.
It's kind of funny, in my opinion, that lack of sleep results in strange dreams that would affect your sleep negatively though. You'd think someone who lacked sleep would simply pass out and sleep like a log, but sometimes lack of sleep doesn't work exactly that way.