01 - Preheat the oven to 375°F. Butter a 9x13-inch baking dish.
02 - Peel and thinly slice butternut squash, parsnips, Yukon Gold potatoes, and leeks.
03 - Melt butter in a saucepan over medium heat. Stir in flour and cook for 1 minute, stirring constantly.
04 - Gradually whisk in whole milk and heavy cream. Cook, whisking until the sauce thickens and is smooth, about 3 to 5 minutes.
05 - Stir in ground nutmeg, salt, and black pepper. Remove from heat.
06 - Arrange half of the sliced vegetables evenly in the baking dish, overlapping slightly. Sprinkle with half of the grated Gruyere. Repeat with remaining vegetables and top with the rest of the Gruyere.
07 - Pour the warm sauce evenly over the layered vegetables and cheese.
08 - In a small bowl, combine breadcrumbs, grated Parmesan, olive oil, and fresh thyme leaves if using. Sprinkle mixture evenly over the gratin.
09 - Cover the dish loosely with aluminum foil and bake for 30 minutes.
10 - Remove foil and continue baking for 20 minutes or until the top is golden and bubbly.
11 - Allow the gratin to rest for 10 minutes before serving.