This happens if I take too much melatonin. The dosage in US-sold melatonin is unnecessarily high. Finnish tablets are typically 1.9mg, while US ones can have 10mg in just one.
I take melatonin (0.2mg via a spray). It is very effective. Nightmares are a recurring problem for me and other users I know, but can be solved with low doses and a lot of discipline.