I'm not a nutrition scientist, so obviously not at all an expert that can probably chime in with some more findings.
But generally - yes, afaik there's mostly a consensus that total caloric intake is the driver of amount of adiposity, that maintaining a 10%-20% body fat percentage (for men) is optimal for long term health, that most diets are close from a health and fat-loss perspective - meaning, amount of adiposity is the main driver of long-term bad health, especially as compared to individual ingredients. There are some things that are known to be specifically problematic, e.g. trans-fats, at any amounts. And there are healthier and less healthy foods, some of which we know - but total caloric intake is the only driver of body composition, and a bigger driver of body health.
Most of this is basic - probably because, as I said, I'm not a nutrition scientist myself so only understand the basics myself.
That said, a large part of the population doesn't even understand these basics either, preferring to constantly talk about and argue about specific diets, keto vs. vegan vs. whatever. And science mostly has that question covered, as far as we can tell right now.
For a more in-depth take on this from someone who actually is an expert, I recommend videos by Mike Israetel:
https://www.youtube.com/watch?v=7FM9VAH_EXw&list=PLyqKj7LwU2...
https://www.youtube.com/watch?v=TYeZVfPxwKM