Preheat the oven to 350F and grease a 9x13 inch baking dish with nonstick cooking spray or with butter.
In a medium frying pan set over medium heat add 2 tablespoons of butter. Once the butter is melted and starting to bubble, add the chopped leeks and cook, stirring often until just softened, 4-5 minutes. Set aside.
When the oven is preheated, add the torn croissants to the greased baking dish, spread out into a fairly even layer (it’s ok if some pieces overlap) and bake in the oven for 5 minutes. Remove from the oven and set aside.
In a large bowl make the egg mixture by whisking together the cooked leeks, eggs, whole milk, dijon mustard, dried thyme, garlic powder, kosher salt, ground pepper and ground nutmeg until well combined. Once well combined, whisk in 1 cup of the shredded gruyere cheese until well combined. Set aside.
Distribute 3/4 cup of the torn ham in between the croissants in the baking dish.
Slowly pour the egg mixture evenly over the croissants and ham in the baking dish. Finish by sprinkling the remaining 1 ½ cups shredded gruyere cheese over top of the casserole and then nestle the remaining ¼ cup of torn ham into the cheese.
Cover with foil and let stand at room temperature for 30-45 minutes before baking. Or, cover tightly with foil or plastic wrap and refrigerate for up to 12 hours.
If the dish has been refrigerated, remove from the refrigerator, remove the foil and let it stand at room temperature for 30 minutes before preheating the oven to 350F.
Remove the layer of aluminum foil before baking!
Bake until the egg mixture is set and the top is bubbling, golden brown and puffed up, about 40-45 minutes. (You may need 10-15 minutes more baking time if baking straight from the refrigerator).
Let cool for 5-10 minutes before serving garnished with fresh thyme leaves.