I would look into your ca/mg supplement and see if they are indeed creating the symptoms you describe (the same happened to me).
You can google dysautonomia for a more thorough explanation but it's a basically a malfunctioning of the autonomic part of the nervous system due to underlying conditions like infections, nutritional deficiencies, etc.