Preheat oven to 350 degrees F (175 degrees C). Grease a 9x13-inch baking pan.
Melt margarine in a skillet over medium heat. Add carrot, celery, and onion; cook until onions are tender and translucent, about 5 minutes. Add salt, cinnamon, and pepper. Remove vegetable mixture from heat.
Combine bread cubes, apples, and walnuts in a large bowl. Add vegetable mixture and drizzle with vegetable broth until evenly moist.
Bake in the preheated oven until golden brown on top, about 30 minutes.