I have researched this extensively, for I suffer of Leaky Gut and AF. The answer is, both can be causes and consequences. Furthermore, something else could have caused these. Leagy Gut can cause AF and viceversa. AF also causes thyroid problems and together these two problems really screw up a gut.
The only things that helps my leaky gut (my inflammed gut I would say rather) are 6 propolis capsules Y.S. Bee Eco per day and eating a lot of raw aloe vera pulp directly cut and peeled by me.
You sound a lot like you got first AF for what is worth. Remember that over time it also causes hypothyrodism. But you gotta deal with AF significantly before any thyroid treatment.
You also need to avoid dairy, gluten, soya and corn. And more, research autoimmune diets. The more restricted the diet the less inflammation. Say bye bye to enjoying food :(... hehe Some of the healthy stuff is enjoyable but in all honesty... yeah say goodbye for now to enjoy eating.