I love butternut squash -- well, all fall and winter squash, actually. And depending on where you live or how early or late in the season it is, you may not find a good butternut. That's why I made this casserole so that you can swap in whatever cold-weather squash you like or can find. Just use the same weight and bake until completely tender. And if you are not into meat or bacon, you can leave that out, too, -- just add an additional 4 ounces of your favorite mushrooms for even more umami.
Arrange a rack in the center of the oven and preheat to 350 degrees F. Brush a 9-by-13-inch baking pan with 1 tablespoon of the olive oil and set aside until ready to bake.
Heat 1 tablespoon of the remaining olive oil in a large skillet over medium-high heat and cook the bacon, tossing occasionally, until the fat has rendered and the bacon is deep golden brown and crispy, 5 to 7 minutes. Use a slotted spoon to transfer the bacon to a large heatproof bowl, leaving as much fat in the skillet as possible. Add 1 more tablespoon oil to the skillet and half the mushrooms. Cook, undisturbed, until browned, about 3 minutes, then toss and continue cooking, undisturbed, until browned on the second side, about 3 minutes. Transfer to the large bowl. Repeat with 1 more tablespoon oil and the remaining mushrooms.
Heat the remaining 2 tablespoons oil in the same skillet and cook the onions and garlic over medium heat, tossing occasionally, until golden brown, about 5 minutes. Add the 1 tablespoon rosemary, 1 tablespoon sage, 1 tablespoon thyme, all of the nutmeg and cayenne, 4 teaspoons salt and 1 teaspoon black pepper; cook until very fragrant, about 1 minute. Add the flour, stir until completely coated and cook for 1 minute. Add the milk, bring to a boil and cook until thickened, about 2 minutes. Stir in the Parmigiano and Gruyere and transfer to the large bowl; add the squash and toss to combine. Transfer to the prepared baking pan, cover tightly with foil and bake until the squash is tender and the gratin is boiling rapidly, 60 to 75 minutes. Remove from the oven and let sit covered until ready to serve.
Meanwhile, rinse and wipe the skillet clean and melt the butter over medium-high heat. Cook the bread, tossing frequently, until golden brown, about 5 minutes. Season with salt, add the remaining 1 teaspoon each rosemary, sage and thyme, tossing until completely combined and cook until very fragrant, about 1 minute. Transfer to a paper towel-lined plate. Just before serving, uncover the gratin and top with the herbed croutons.