Harmful effects of intermittent fasting

I asked my doctor about intermittent fasting. He said that it could work and to try it out if I want.

But he also said that if I consume the daily calories in a short window (eg
the 4-6 hour eating window) that my body will learn to store the food as fat immediately since it does not need all of it at the moment.

Is that a risk or consideration?