Preheat your oven to 350°F (175°C). Spread the bread cubes on a baking sheet and toast them until golden brown, about 15 minutes. Let them cool.
In a large skillet, melt the butter over medium heat. Add onions, celery, and carrots, cooking until softened, about 10 minutes.
Add garlic and mushrooms and cook another 5 minutes.
In a large bowl, mix the toasted bread cubes, sautéed vegetables, parsley, and rosemary.
Pour the vegetable broth over the mixture and stir until the bread is evenly moistened.
Stir in the beaten eggs and Parmesan cheese. Season with salt and pepper.
Transfer the mixture to a greased 9x13-inch baking dish. Cover with foil and bake for 30 minutes. Remove the foil and bake another 15-20 minutes until the top is golden and crispy.
Let it sit for 10 minutes before serving.