Hello and hope you are doing well.
The reaction is unlikely, as melatonin is a naturally occurring hormone. But please don't venture to take sedatives and controlled substances without the supervision of a doctor. Besides, drug-drug interactions, we never know the metabolism status unless tests have been done to justify their prescription. So, Discuss the options with your consulting doctor.
Hope this helped and do keep us posted.
There is no known reaction between these medications. Melatonin isn't usually used for insomnia because it doesn't work very well. Ambien is only meant to be used for short term use which often results in worsening of insomnia (sometimes worse than it ever was) when trying to come off the medication.
A Harvard study in 2004 demonstrated medications are not the best treatment for insomnia, but rather Cognitive Behavioral Therapy for Insomnia (CBTi) is better. CBTi is safe in the long term, is less expensive, has no side effects, and treats insomnia at the root cause instead of just trying to "knock someone out" like medications do. If you go see a sleep doctor in person, CBTi is what they will recommend. Alternatively, online programs have been found to be equally effective and less expensive.
Rest well!
I would think it was the Ambien alone causing the problems, but anything is possible. Ambien has a lot of possible side effects. I've taken melatonin without problem, but it is illegal in Europe.