I had long periods where I could not sleep while fasting but I would always get a little sleep each night. I only slept about 4-5 hours per night. As I was fasting I read more on the subject and found that you need less sleep than while eating. While much of the Science
about sleep is unknown -- this seems to be related to both sleep and fasting being restorative times for the body. That is to say, while fasting, much of the housekeeping, cleansing, and re-energizing that the body theoretically does during sleep - is already taking place round the clock during your fast. Consider that much of your awake time fasting consists of sitting or lying down and meditating because your energy is so low. This is a state closer to sleep than you would usually be in during the day.
I read that the faster needs an average of 3 hours less sleep per night than their usual. So instead of lying restlessly in bed for 8 hours, try staying up later and planning on only a short sleep. I usually lacked the energy to do much with these extra hours in the middle of the night - I would typically sit quietly in darkness and occasionally move from indoors to outside, sometimes read a little bit - but it was much more comfortable than lying in bed and trying to sleep when I wasn't tired.