I think we're in the same boat. I have chronic migraines, IBS, and HI. I follow a migraine, FODMAP, and low histamine diet. They help a lot but only up to a certain point.
To answer your question onions are a big doubly whammy for me. They trigger really nasty migraines and IBS symptoms. Garlic is much more tolerable and seems to cause only moderate GI upset.
Have you tried any of the low FODMAP garlic seasonings? I find them to be much easier on my system.
https://smile.amazon.com/gp/product/B08JH96XBV/ -- great stuff
This guy and this guy have been my two best friends while figuring out how to live life cooking without standard minced garlic (I'm Italian/Jewish).
Both brands also have onion replacers that are good too. The FreeFod stuff is STRONG. I use enough to cover the front third of a standard eating spoon and it's enough to flavor enough food for 6 people.
I use EVOO a lot for cooking but I don't want it flavored, so I've never tried the infused oils honestly. I have a super sensitive gut though, and thus far haven't had any issues with the powders.