Chris DWe have a 6 yr old son with SW CAH. There are two times when I notice extreme moodiness and "terrible" behavior. One is when his meds are off (this has happened a couple of times), the second is when he is hungry (this happens much more often).
Given that cortisol affects blood sugar levels, I do think it is related to his CAH. For my son, aggressive or irrational behavior is often a blood sugar issue, not a med issue.
What works best for us is prevention. When he was younger, I had to make sure he had some kind of snack or meal every 2-3 hours. It also seemed important to make sure there was some protein in the snack so he wouldn’t get the blood sugar spike. (e.g. crackers and cheese, not juice and teddy grahams). As he has aged, it has become less of an issue, but he still needs some kind of protein balanced meal every 4-5 hours. He is not super into meat or peanut butter, so I make sure he has at least a glass of milk with every meal.
Now, all that aside, he has to live in the same world as the rest of us, so we have worked very hard on his behavior. Once he has eaten, we talk about how he acted and why that wasn’t appropriate. Slowly, slowly, over the years we have come to the point where I can stop him in the midst of a tantrum and remind him of previous situations and the consequences for his actions. (Of course my son is 6+ now and your granddaughter is a little young for all this, but as she gets older it might become easier).
Hang in there. I hope this helped a bit.
-Chris