The main issue is overconsumption leading to overweight and obesity. Food that’s high in refined sugars and/or saturated fats tend to contribute to this, because it’s palatable and calorie-dense
So in that sense, yes - I believe that as long as your diet is varied enough that you get sufficient intake of all, or at least most, of the essential nutrients, and you don’t eat too much (i.e. in moderation), the ratio of macronutrients doesn’t make a big difference to your health outcome
The crux is that moderation is hard when the food is jam-packed with calories, and it’s so delicious you just want to keep stuffing your face