Let's say you're being fed just the amount of calories your body needs to maintain. What influence on body fat has the distribution of carbs, protein and fat from food then?
My point was that regardless of what you eat, if you eat more than your body expends, some of the excess will be used to produce fat and you will gain weight. If you lead a sedentary lifestyle and eat 3000 calories of nothing but lean meat per day, you will gain weight.
You are right that different foods (macronutrients, more specifically) have different thermic effects and therefore require different amounts of energy to metabolise. Protein takes more energy to process than fat. This does not change my overall point.
Not much for getting lean but it's easier to overeat carbs and fats are calorie dense. That said you need to eat a mix of the three to be healthy because they all have important body functions.