This problem can suddenly take place and often veterinarians cannot diagnose it quickly. I have already mentioned this, but I will repeat it, because it may be useful to someone.
At first you might think that your dog has an injury or an acute illness of the internal organs. It screams as you try to touch it. It does not want to move. But, if it turns out to be in conditions that it likes, for example, on a walk, the "pain" disappears ... The appetite is usually normal, the temperature also. The vet is puzzled and so are you ...
So a magnesium deficiency can manifest itself. The reasons may be different. For example, in our place it is bad water, which "washes" magnesium from the body. Magnesium deficiency can cause cramps and tachycardia.
Of course, this is one reason why your dog is crying in pain. But, if all the causes of her illness are already excluded, try this. We spent half a year to have a diagnosis. No one even thought of such a reason. Maybe this may be useful.