Heck, you could probably get PAID to haul away food waste in the right situation!If there were enough leftovers, of the right kinds, then the chickens would probably do fine. But there would always be a pile of stuff that they didn't eat.
For example, if you gave them the leftovers from a school or restaurant, they might eat all the meat & eggs, half of the veggies and fruits, and a quarter of the bread--leaving a big pile of bread and some other stuff that might just rot and stink, or that you could compost (and then the chickens could pick through the compost for worms and bugs.)
If the food scraps really are free, AND if you have few enough chickens compared to the amount of food, AND if you're willing to take the time to manage it, that could work fine. But for most people, it's not the best choice.
Composting the “leftovers” is key as you said...keep the smell down, attract worms and bugs, and make a useful end product.
I have two compost piles In my run...one active and one resting. They both hold roughly 800 cubic feet of material. I add roughly a half pickup bed of food scraps twice a week to the active pile, plus enough carbon to offset that.
I was turning some compost last week, literally two days after the snow had melted, and uncovered a ton of worms. That’s free protein for the flock!
But yeah, mine is not the average backyard setup!