If you’re eating late at night you want to avoid carbs, particularly if you’re worried about adding body fat.
However, during the night is when your muscles are recovering and hopefully growing. Therefore, this is a vital time to have amino acids in your system in order to facilitate this. If your not eating for a few hours before you go to sleep, then overnight, you don’t consume anything for maybe 8 hours, your body is going to be seriously catabolic. I always have a protein shake before bed, and if I’m trying to add bodyweight, I might have one if I wake during the night.