with time restricted eating it is typically recommended to have your last meal by 6 or 7 if you intend to sleep by 10pm. There are a number of health consequences to eating so late. The one most people care about has to do with the pancreas receiving melatonin and slowly beginning to shut down for the night, so when you eat late it has a lower insulin response than it would otherwise leading to more calories being stored as fat instead of being used as energy. There are some metabolic consequences as well.