One more mundane possibility - spicy foods, esp (in my experience) members of the red pepper group. Cayenne, etc. Have you taken up new cuisines?
(My view of nightmares is that chemicals are causing your poor brain (which is a very sophisticated chemical plant) to rattle like a freight train. Sometimes (like just after 9/11) the chemicals were caused by stress related to life experience, but often the chemicals come from something we ate, drank, inhaled or took in somehow.)
If spicy food is not it - if I were you, I'd see either a gynecologist or an endocrinologist. I'd suspect menopausal symptoms or I'd suspect that the thyroid medication is not right for you.
You might be able to call the doctor that prescribed the thyroid medication and report the night sweats. They might just prescribe a new kind to try.