Have you closely studied or tried to modify your eating habits before these races? Some people have tricky stomachs that can handle some things and not handle others. Personally, I know I have to be more careful before a high intensity effort than I do before a lower intensity, more drawn out effort.
If you have done so, please excuse me for asking what may seem like an obvious question. If not, I’d suggest trying to adjust both how close to your races you eat and what you eat. I had a teammate once who could eat a banana 3 hours before race time and nothing else within 5 hours of race time except drinking water.