some certain people can eat carbs throughout the day and at night and they do not add significant or extra amounts of fat.
but because carbohydrates are the greatest sourse of energy for our body, if a surplus of carbs are eaten at night(right before bed in this case), the body will convert the carbs to glucose for energy(as always). but if the glucose is not used(carbs before bed)in some kind of activity, then there is an increased chance that the glucose can be stored in your body as lipids(fats) for future energy use.
certain people are carb sensative and their body will add on fat when carbs are given at night.
but nevertheless, the law of energy balance still stands. if you eat at maintenance, or below maintenance calories, there is no way for your body to add fat even if you eat carbs before bed.