I just want to say - no one can agree on this question.
And to be fair, it is a tough question to answer. We are all different individuals with different backgrounds, different chemical makeup, and different responses to food. We interact with food on a daily basis and all have an opinion on the matter. This is why nutrition and dieting will always be a melting pot of discussion.
In the simplest of terms, food can be broken down into categories such as meats, vegetables, fruits, nuts, seeds, oils, fats, etc. Of the chemical make-up of food, there are macronutrients: proteins, carbs and fats. These foods and macronutrients have a numerical value of energy expressed as calories or Calories (capital “C” is an indicator of 1000 units.) Calories measure the thermodynamic energy the food contains - how much heat is given off when consumed .
When dieting, practitioners, nutritionist, fitness professionals or specialists will focus on how many calories one consumes on a daily or weekly level; Some will focus on the macronutrients, and others will focus on the quality of food (i.e. organic, meats, vegetables, grains, etc.)
Some think so and there is science to prove these claims, such as caloric counting.
Regardless if you're counting the calories of a meal or food as a whole, or tracking the macronutrients - each macro gives off a certain amount of calories regardless of the food source - consuming more calories than your body needs to operate on a daily basis will increase the mass in your body (gain weight.) If that caloric number is under the daily requirement, you will decrease the mass (loss weight.)
The law of thermodynamics is clear that weight loss can be expressed as a relationship or balance of energy in the body and with food. Calories are important but are they the clear definitive goal?
Dieting is defined as a restriction of food - expressed in many different ways. Common diets include keto, vegan, Atkins, paleo, caloric counting, pescatarian, and more. These diets take an element of food intake and restrict or reform different variables that range from which type of foods you’re allowed, what time of day you can eat, how much of something you can eat, particular foods, particular macronutrients and more.
In one way or another, the balance of calories is at play. Some aim to gain awareness of calories directly and some focus on different variables so one's focus is not directly linked to counting or controlling calories.
Is one more rigid than the other? If I were to say restricting what types of food to eat was more rigid than restricting how much I eat, I would be contradicting myself because a restriction is a rigid metric itself. So rigid would be defined as how many restrictions I put in place and not the quality of restrictions instead.
If you’re on more restrictions when it comes to dieting, does that aim to accomplish your goals? More importantly, is it sustainable for the future?
Again, this is dependent on the individual. Some have stronger cravings or addictions to foods, while others feel little to no temptation when cutting out different foods. Disorders are becoming more prominent and solutions seem to be more pressing . So how does one create a positive relationship with food and still maintain good health?
Does allowing someone to eat what they want to provide better health in the long run or does a restriction work best? Poor nutrient intake can be as much a predecessor to poor mental health. Where do we draw the line and how do we include balance in this equation?
This is the dilemma of a ‘balanced diet.’ Diets in nature are not balanced. They are a restriction of some sort aimed at achieving a goal - typically with weight loss.
Does becoming a vegetarian solve your problem? Does cutting out carbs help? Will I be able to function if I can’t have any fat? Will I be able to live life without bread? Do I simply eat anything to save myself from mental distress?
What we can agree on is that these goals revolve around calories and macronutrients. Though that is a simplistic view on the matter, it can be boiled down to these metrics. How we go about controlling these metrics is entirely up to you and/or your specialist.
A simple solution is a trial-and-error method. Taking notes, measurements, qualitative analysis and feedback questionaries should be included in any dieting methodology. This way you can address the physical response of a diet, your willingness to corporate, and the mental relationship.
An underlining goal should be sustainability in the end and addressing the issue of balance will be an ongoing endeavour.
Those educated in prescribing food, meal plans or nutritional advice will typically have their favourite methodology for dieting and that is okay. I’d rather have a specialist prescribe the methodology they study endlessly and know inside and out than one that prescribes a method that they know little about.
You will have to determine if it is the best solution for you. Regardless, every plan should have flexibility built-in. Rigidness will help you achieve your goal but flexibility will help sustain your dieting needs for the long run. If you feel you can maintain your rigid diet, you see the results and feel great while doing it, by all means, continue to eat that way.
Balanced is achieved through trial-and-error and working through what aids you best. There may be times when more restrictions will be needed to be put in place to achieve your goal but in the end, once your goal has been achieved, maintaining something sustainable will be the next step.
 Andrea C Buchholz, Dale A Schoeller, Is a calorie a calorie?, The American Journal of Clinical Nutrition, Volume 79, Issue 5, May 2004, Pages 899S–906S, https://doi.org/10.1093/ajcn/79.5.899S , Howell S, Kones R. "Calories in, calories out" and macronutrient intake: the hope, hype, and science of calories. Am J Physiol Endocrinol Metab. 2017 Nov 1;313(5):E608-E612. doi: 10.1152/ajpendo.00156.2017. Epub 2017 Aug 1. PMID: 28765272.  Smith CF, Williamson DA, Bray GA, Ryan DH. Flexible vs. Rigid dieting strategies: relationship with adverse behavioral outcomes. Appetite. 1999 Jun;32(3):295-305. doi: 10.1006/appe.1998.0204. PMID: 10336790  Stewart TM, Williamson DA, White MA. Rigid vs. flexible dieting: association with eating disorder symptoms in nonobese women. Appetite. 2002 Feb;38(1):39-44. doi: 10.1006/appe.2001.0445. PMID: 11883916.