Preheat oven to 350°F.
Caramelized Onions
Heat a skillet over medium-high heat and when hot, add the oil, butter, and onions.
Turn the heat to low and cover with a lid and cook for 25-30 minutes until the onions are softened
Turn the heat to medium and cook until the onions are golden brown, stirring occasionally
Cover and remove the pan from the heat and set aside.
Mac and Cheese
In a saucepan over medium heat, melt the butter.
Add the flour and whisk constantly for 1-2 minutes (or until the mixture turns light brown).
Remove from heat and gradually pour in the warm milk and beef stock, whisking constantly.
Return the pan to the heat, whisk another 3-5 minutes or until thickened.
Add the salt, garlic powder, ground mustard, and cayenne pepper and stir to combine.
Add the cheeses and onion mixture, stir until all of the cheese is melted.
Pour the sauce over the top of the cooked elbow macaroni. Stir to combine.
Add the shredded rotisserie chicken and stir until completely mixed together.
Topping
Top with ¼ cup shredded Gruyere cheese
Bake, uncovered, for 12-15 minutes, or until golden brown.
Season with salt and pepper, and top with chopped thyme.