Answer: Possibly...and probably NOT because of the reason you would think!
Let's go back to how the body FUNCTIONS ... because YES, I'm a teacher ... and I can't help myself but "teach" everything ...
While you sleep, your body takes time to repair, heal, and detoxify from the day. It is a VERY important process, especially in our modern world where we are exposed to THOUSANDS, if not millions, of toxins ALL. THE. TIME. in our food, our environment, etc.
If you eat late at night, your body will need to digest that food. But guess what ... it will PRIORITIZE that late night food over healing and detoxifying!
Why? Because if food just sits in your system, it will damage the gut lining. So digestion is like your oldest sibling growing up...always the front seat privilege!
So why do people tend to gain weight if they eat late at night?
Because of those priorities...your body will naturally have to hold on to all those toxins and guess where they are stored? Adipose tissue aka fat.
FOR EXAMPLE, let's say you only had breakfast one day and did not get to eat again until right before bedtime. Even if you were at a caloric deficit for the day, the body has to work the way it was designed and you will interrupt that natural detoxification process! Digestion first, toxins second. Depending how well your digestion system and detox system are working, that can lead to fat storage.
Bottom line: NOT eating late at night will help the body be HEALTHY and in it's most natural state so it can do the job it was designed to do!
Live Life Well,