While holding a carrot in the main-hand, you can not place blocks or torches with off-hand. It works with any other food.
Steps to reproduce:
make sure you aren't hungry aka hunger-bar is full
hold carrot in main hand
hold torches in off-hand
try to place torches
it won't work
Holding any other food, even golden carrots, works, this bug just happens with Carrots as far as i know.
Fix it, mojang.
Carrots are placeable. This is MC-126337, which has been resolved as "Works as Intended".
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki