No… A couple things:
Usually a lot of medicines they recommend you take with food, this is because food helps those things disperse through the body better.
On an empty stomach, while in a dehydrated state? Probably end up feeling light headed AF
 
Truthfully, fasting isn’t a miracle cure all. Do you understand WHY fasting is beneficial for the body, or did you just read some new age pseudo science on it?
The point of fasting is to rid your body of toxins and artificial chemicals you’ve accumulated…
Why would you toss drugs into your system while it’s doing this?
Not a good idea, no. Get some light exercise or something, read a book in bed, there’s so much more you can do to try and sleep than taking some drugs. You’ll ruin the whole point of fasting in the first place.