Coconut products just do not agree with me, so it's possible you're like that too. I will be nauseous & in pain for days if I eat even a tiny bit of coconut. That wouldn't explain why the almond milk also affected you, though.
I guess it's possible it was carrageenan? Many almond milks contain carrageenan - I obviously don't do coconut but perhaps coconut milk contains it as well. It's an additive that can in some cases cause GI upset in normal/healthy people and can cause us IBD'ers to become even sicker. I can tell you that the Whole Foods store brand and also the Silk brand of almond milks do not contain carrageenan, but most others do contain it.
Otherwise, the only thing I can think is, any milk product or milk substitute is probably going to be a bit high in fat and sugar. Perhaps it was the fat or sugar content that caused you trouble?