Technically this is true, but in practice strict calorie deficit diets don't work for most people. To be in a calorie deficit state is a state of starvation, and most people's entire biological drives rail against it. What usually happens with these kinds of diets is the person will do well for a time, but the constant starving will drive them to either start unconsciously sneaking in more sources of calories, or they'll outright rebound into eating even more than they did before.
Sustainable weight loss ultimately comes down to living healthy by default.
https://en.m.wikipedia.org/wiki/Adventist_Health_Studies