If you haven't been tested for gluten allergy I'd ask for that (in the meantime it's important to keep eating the gluten to get an accurate result). If you have had the test and it came back negative for allergy, you may still have an intolerance to gluten. Dairy, and indeed many other foods could be the culprit.
If you've had gluten test, then I'd try cutting gluten and dairy out of your diet for a few months, and if that helps gradually reintroduce them one by one, i.e. oats and see what reaction you get, then if ok maybe wheat or barley etc, same with dairy.
Another possible culprit could be one of the bulk fillers in medication as they vary from brand to brand. I'm fine with some brands but can't tolerate some at all.
You have to play your own detective and I found that the coating on Loperamide was making my symptoms worse, not better, so had to switch to the instants which dissolve under your tongue. Hope this helps.