What I have been told, the no-no list to feed chickens are: potato peeling, citrus, onion and garlic (although garlic clove smashed in their water can be a good thing & I have done). I think the main prohibition about onion and garlic is that the meat & eggs will taste like onion and garlic . . . . perhaps, and is only my opinion, the diarrhea will pass when the onion is out-of-their systems (could be like introducing a new feed suddenly).
Also, too much of any one thing is not good unless it is a balanced feed. 3 cups of raw onion sounds excessive-- how many birds?
I also subscribe to the too much salt (NaCl) is a dangerous thing -- primarily because the chicken's body can only rid itself of a certain amount of salt in a certain amount of time & they could die from too much. I once had the NaCl in dog & cat food computed to what the chicken's system could rid . . . . and found there was no danger of ingesting too much NaCl in those pet foods. However, I would never feed my birds potato chips for instance.