Preheat the oven to 400 degrees F.
Heat a large skillet over medium-low heat and add the pancetta. Cook until the fat is rendered and it is mostly crispy, then remove it with a slotted spoon. Place it on a paper towel to drain excess grease.
Remove half of the pancetta grease from the skillet and set it aside. Add the shallots and the brussels with a pinch of salt and pepper to the skillet and toss well, cooking until softened, about 8 to 10 minutes. Transfer the brussels to a bowl.
Add the remaining pancetta fat back to the skillet. Add the mushrooms and garlic and stir, cooking until softened, about 6 to 8 minutes. Season with the thyme and a pinch of salt and pepper. Transfer the mushrooms to the bowl with the brussels. Add most of the grated gruyere and parmesan to the brussels mixture. Toss in the pancetta. Place it all in a 9x13 inch baking dish.
In a large bowl or measuring cup, whisk together the cream, dijon and nutmeg. Pour the cream over the brussels and very gently toss. Sprinkle the remaining cheese on top. Bake for 20 to 25 minutes, until bubbly and golden. Remove the gratin and sprinlkle the pecans on top. Bake for another 10 minutes. Let cool slightly before serving.