There is a mechanism behind it. Eating a large meal close to sleep raises your core body temperature and triggers digestive activity that interferes with the drop in body temperature your brain needs to initiate sleep. The timing effect on sleep is pretty well supported.
