Preheat the oven to 375°F (190°C). Grease a baking dish (9x13 inches or round 3 quart casserole) and set aside.
Bring a large pot of salted water to a boil. Add the Brussels sprouts and cook for about 5 minutes, or until slightly tender. Drain and set aside.
In a large skillet, heat olive oil over medium heat. Add the chopped onion and cook until translucent, about 3-4 minutes.
Add the minced garlic and sliced mushrooms to the skillet. Sauté for another 3-4 minutes, until the mushrooms are cooked and any excess moisture has evaporated.
Stir in the dried thyme, salt, and pepper to taste.
Sprinkle the flour over the onion and mushroom mixture. Stir well to combine and cook for 1-2 minutes, allowing the flour to cook and eliminate the raw taste.
Gradually pour in the milk and vegetable or chicken broth, stirring constantly. Cook and stir until the mixture thickens and becomes smooth, about 3-4 minutes.
Add the shredded Gruyère cheese to the skillet and stir until melted and incorporated into the sauce. Remove from heat.
In a separate bowl, combine the grated Parmesan cheese, breadcrumbs, and melted butter. Mix well until the breadcrumbs are evenly coated.
In a large bowl, gently stir together the blanched Brussels sprouts, pimentos, and cheese sauce. Transfer the combination to the prepared baking dish.
Sprinkle the breadcrumb mixture over the top of the casserole.
Bake in the preheated oven for about 20-25 minutes, or until the casserole is bubbly and the top is golden brown.
Remove from the oven and let it rest for a few minutes before serving.