In a large skillet over medium heat, melt 2 tablespoons of butter with the olive oil.
Add the sliced onions to the skillet.
Sprinkle with 1/2 teaspoon of salt and 1/4 teaspoon of black pepper.
Cook the onions over medium-low heat, stirring often, until they are golden brown and caramelized, about 40 minutes.
Stir in the fresh thyme leaves during the last few minutes of cooking. Set aside.
While the onions are cooking, bring a large pot of salted water to a boil. Cook the pasta according to the package instructions until al dente.
Drain the pasta and set it aside.
Preheat your oven to 425°F.
In a large saucepan over medium heat, melt the remaining 2 tablespoons of butter.
Add the flour and whisk constantly for 2 minutes to make a roux.
Slowly whisk in the whole milk until the mixture is smooth.
Stir in the dry mustard powder, Worcestershire sauce, remaining 1/2 teaspoon of salt, and remaining 1/4 teaspoon of black pepper.
Keep cooking the sauce, stirring frequently, until it thickens and coats the back of a spoon, around 5 minutes.
Take the sauce off the heat. Set aside 1/4 cup of grated cheddar cheese for topping. Then, stir in the rest of the shredded Gruyère and cheddar cheeses until fully melted and smooth. Adjust salt and pepper as needed.
Combine cooked pasta, caramelized onions, and cheese sauce in a large bowl. Mix well to coat evenly.
Grease a 9x13-inch baking dish. Pour the mixture into the dish and spread it evenly.
Sprinkle the panko breadcrumbs evenly over the top of the pasta, followed by the remaining cheese.
Cover with foil and bake in the preheated oven for 20-25 minutes, or until the sauce is bubbly. Remove foil during the last 5 minutes of baking to help brown the top.
Let the mac and cheese cool for a few minutes before serving. Garnish with fresh parsley.