In answer to your question, yes I did try the Paleo Code. It's a good programme, I think, if you're inclined to be patient and work through the process. He's very systematic and has a good knowledge of the science. I didn't carry on with it because I'm not from the US and I found the continual need to translate the programme into my world to be really irritating!
I also have multiple health issues, so while I'm not totally disagreeing with the last two posters, I think that issues around weight gain are more complicated than simple physics suggests. I have been in the position of eating very few calories from a medically managed liquid only 500cal diet and not losing a single thing. We're all different - the Paleo Code helps you to figure out which tweaks are likely to help you.
I have Hashimotos Thyroiditis. My experience was that I could *not* lose weight, PERIOD, until I got my thyroid meds dialed in. It was NOT just a simple version of calories in/calories out the way some people say it is. When you have a thyroid issue, all bets are off because the thyroid is the master gland that controls your metabolism. You mentioned that your dietary change affected your thyroid. It may well be that you need a dosage adjustment- particularly if you have Hashi's. Hashi's tends to ebb and flare, and if you're in a flare you're going to have difficulty losing weight. Hashi's also has a tendency to get worse over the course of time, so most people find they need more meds as time goes long. You don't mention which med you're on. If you're taking synthetic T4 only med (Levothyroxine or Synthroid) then you may want to try a natural desiccated thyroid med (under brand names Armour, Naturthroid, Westhroid, Erfa) because if you have a T4 to T3 conversion disorder (many people do) then you won't ever feel good on Levo or Syn because that's a T4 only med. Desiccated thyroid has T1, T2, T3 and T4. So it may be worth a try if you haven't tried that before.