Yes, this could be from the Magnesium. Try reducing the dose of magnesium and see what happens.
Chronic Lyme Disease, Gluten & Sulfite Sensitivity, Many Food/Inhalant/Medication/Chemical Allergies & Intolerances, Asthma, Gut issues (dysmotility, non-specific inflammation), UCTD ("Secondary Lupus-Like Syndrome"), Osteoporosis, Pancytopenia, chronic malabsorption/malnutrition, etc.; G-Tube; Currently TPN-dependent.
Meds: Zofran, Pulmicort, Heparin (to flush PICC line), Claritin, Colloidal Silver (used topically), IV Milk Thistle, probiotics.