I am a firm believer that our body has the ability to repair and balance itself in every part and on every level.
Even if one of your glands has partially been removed in surgery, I feel the body has the ability to rebalance itself and create a new equilibrium.
I must admit I do not know very much about your condition and I would recommend continuing to discuss this with your doctors and specialists.
But what I did notice from your message was the depth of your feelings and emotions concerning your levels of calcium and magnesium. I feel your feelings and emotions may be having a much more powerful effect on your body, than the taking of the supplements you described.
Your body is a hologram of your thoughts, feelings and emotions about it. Therefore from your question I got the feeling that because you kept repeating you had this problem and concern: your body was showing up with this conditions as it does not want to prove you wrong.
Therefore, I would say to listen to your self-talk and ask yourself if it is helping to bring balance back into your system? If your thoughts about your body are of harmony, peace, love and support then I feel you will aid the healing process. Positive thoughts can help to bring feeling of love, warmth and healing into the area of your body where you feel this lack or discomfort or dis-ease.
What I find helps myself is to do a Smiling Meditation. Take the attention within and become aware of your body from the inside. Take the awareness to your face and smile softly, feel the effect this has on your feelings and emotions.
Take your awareness around your body and visualise each organ in turn with a big smile on its face and breath love into every cell that makes up that organ so you can see a smile of each cell of your body.
You could even try going a little deeper and breath love into all the molecules that make up the cells visualising each one in perfect balance and health. Feel the waves of love and supportive emotions as you do this.
Go a little deeper and see all the electrons spinning around the nuclei of the atoms of your body; increase the vibration so you can hear them all singing in harmony with each other. Drop down out of your physical body altogether and see your Self the underlying field of Spiritual energy, which forms your energy body: The blueprint, which the physical body grows into.
See all the layers of your self in perfect peace and harmony, all the layers of energy in perfect balance. Feel the life energy of your consciousness and awareness flowing through the physical structure of your body breathing love and support so you feel whole and compete.
Self love and appreciation of your self will help to heal and bring peace and harmony back into your body.