I've been 9 months gluten free, and while it was a HUGE aggravator in my AF, I don't think it was a core issue. Mine is bad emotional wiring. I am glad you found and eliminated your core issue.
p.s. Thanks for the tips on licorice TEA (sipping, etc). That was a million dollar tip in my recovery. I was taking licorice capsules before and they were way too strong. By gently sipping the (much weaker) tea, I can get through long and grueling days when I need to - with no crash or rebound affect!