One bite of cake the night before is not likely to cause sudden diarrhea the next day. If you had eaten the whole piece, then maybe. And if you’ve been using whey regularly without issues, I don’t think that’s the cause either. The timing fits better with something you ate closer to the episode.