Melatonin has the same affect on me. I don't bother with it anymore. I just need the right strain of pot. LOL
I've heard good reviews of Hydropothecary's "Bedtime" (haven't tried it yet but plan to):
http://thehydropothecary.com/products/time-of-day (down at bottom of page)
https://lift.co/strains/hydropothecary-bedtime/reviews?page=&per_page=&sort=-createdOn
Here's some more potential options for sleep:
https://www.leafly.com/news/strains-products/the-best-cannabis-strains-for-insomnia
This is not an add or endorsement and is only posted as examples to help as I also have sleep issues and have a medical prescription. Please feel free to do research as well to find one that is most suitable.
Thank you & good luck,
OD