While higher ammonia levels could produce the reported symptoms, I would expect that such high levels would produce other symptoms as well. Instead, when I hear the symptoms of muscle cramps and panic attacks, what comes to mind for me is a magnesium deficiency. A high protein diet may enhance the need for magnesium. (Bunce, G.E., Reeves, P.G., Oba, T.S., and Sauberlich, H.E. Influence of dietary protein level on the magnesium requirement,
J. Nutr., 79, 220, 1963.) Your friend may not be eating what is normally considered a high protein diet, but problems with his metabolism that may be related to his illness may mean that he has to consume a higher level of magnesium than normal in order to consume normal levels of protein. Impaired kidney function can result in too much magnesium being excreted, which would also result in higher levels of protein consumption causing your friend's symptoms.
Without adequate levels of magnesium, muscle cramps are one of the first symptoms you would expect to see. As magnesium is the primary antagonist of NMDA receptors in the brain, excessive activity at these receptors would be expected, and in some people this manifests as panic attacks.
Due to your friend's illness and/or impaired kidney function, higher than normal levels of magnesium may be required to eliminate these problems. For this reason, normal levels on magnesium tests do not rule out the need for additional magnesium. Some people are very sensitive to magnesium supplementation, though, so any increase in magnesium consumption should be done gradually. Due to low absorption levels, oral supplementation of magnesium often is insufficient to resolve serious magnesium deficiency. Instead, in terms of potency, the following forms of magnesium may need to be considered, with the most potent listed first: IV magnesium, IM magnesium injections, nebulized magnesium, Epsom salt baths (full and foot baths), and magnesium cream applied to large areas of the skin. The first three methods are by far the most potent. But as most doctors will have nothing to do with them, nebulized magnesium has the advantage that it can be done without involving a doctor (at least in the UK).
Dr. Myhill gives complete instructions on using magnesium by nebulizer, including where to get the nebulizer and magnesium and what dosage to use, in
Magnesium by nebulizer. It would probably be a good idea to start at a lower dose than she specifies - maybe a quarter as much - since some people are very sensitive to magnesium.
If your friend is able and willing to do IM magnesium injections, Dr. Myhill gives instructions and dosage for these at
Magnesium - treating a deficiency. Dr. Cheney uses the same dosage, except that the drug he uses in combination with magnesium is taurine, of which he uses 1.5 cc.