Maybe there are other health effects like people subconsciously eating more because the body is craving certain micronutrients, leading to getting fat from too many macronutrients.
We could do randomized controlled studies, where we first have a phase where everybody just eats what they eats, we record caloric intake and nutrition profiles of the food they eat. To be sure that price is not a factor we pay for all the food.
Then in phase 2 we split into a control group that still buys from any store, a second group that only has access to foods with high nutrition content, and a third group that only has access to foods with low nutrition content. The same types of food should be offered just high and low nutrition options (e.g. zuchinnis, brocolli, tomatoes, apples, ...)
We then check if there's any significant effect on caloric intake (given a certain time for them to adjust).
You could create several cohort with different co-controlled fixes for each: more calories, more protein, more fiber, more nutrients.
Then evaluate the percentage of successfully treated patients in each cohort.
It's of course a difficult study, since someone with a bad diet will lack practically everything, so more things will work than not. I'd also be curious to see how you would design a real food diet high in micronutrients without accidentally adding a bunch of fiber in the process