Preheat the Oven: Begin by preheating your oven to 375°F (190°C).
Boil Macaroni and Broccoli: In a large pot of salted boiling water, cook the macaroni until it's al dente, following the package instructions. About 2 minutes before the macaroni is done, add the broccoli florets to the boiling water. Drain both macaroni and broccoli in a colander and set them aside.
Prepare the Cheese Sauce: In a saucepan, melt the butter over medium heat. Stir in the flour and whisk continuously for about 1-2 minutes, or until the mixture turns a light golden color.
Add Milk and Cheese: Gradually pour in the milk, whisking constantly until the mixture thickens, about 5 minutes. Reduce the heat to low and add the cheddar cheese, Parmesan cheese, salt, black pepper, garlic powder, onion powder, and dried thyme. Stir until the cheeses are fully melted and the sauce is smooth.
Combine Macaroni, Broccoli, and Cheese Sauce: In a large mixing bowl, combine the cooked macaroni and broccoli with the cheese sauce. Ensure that the macaroni and broccoli are evenly coated with the creamy sauce.
Transfer to Casserole Dish: Grease an oven-safe casserole dish with cooking spray. Transfer the macaroni and broccoli mixture into the dish, spreading it out evenly.
Top with Breadcrumbs: Sprinkle breadcrumbs evenly over the top of the macaroni mixture. This will create a crispy, golden-brown crust when baked.
Bake: Place the casserole dish in the preheated oven and bake for 25-30 minutes, or until the top is golden and the cheese sauce is bubbling around the edges.
Serve: Remove the baked gratin from the oven and let it cool for a few minutes before serving. Scoop out generous portions onto plates, and savor the creamy, cheesy goodness!