Heat the oven to 400°F. Slice squash into ½-inch-thick pieces. Lightly butter a baking pan, scatter squash, sprinkle to taste with salt and pepper, and roast until tender, about 30 minutes. Remove the skin and puree enough flesh to make 1 cup puree. Cut any remaining squash into cubes.
Butter a 9-by-13-inch baking pan. Line it with sliced bread, fitting the pieces together as snugly as possible. (You can cut off the crusts for a more refined strata, but it’s not necessary.)
Heat the oil in a sauté pan over medium heat. Add the onion and a pinch of salt; sauté about 5 minutes. Add the mushrooms and continue to sauté until the onion is soft and beginning to brown, about 4 minutes more. Add the garlic and cook a few more minutes. Pour in the wine and cook, stirring occasionally, until the liquid is reduced by half.
Spread the onion mixture over the bread. Scatter the cubed squash on top, then sprinkle on half the cheese. Crack the eggs into a bowl. Add the squash puree, half-and-half,
½ teaspoon salt, and freshly ground black pepper. Whisk until smooth.
Arrange a second layer of bread over the cheese, then pour the egg mixture over the bread. Sprinkle the remaining cheese over the custard. Cover with plastic wrap and weight the top with a slightly smaller baking dish. Refrigerate at least 4 hours or as long as overnight.
Heat the oven to 325°F. Let the strata stand at room temperature while the oven heats. Bake for 60 to 75 minutes, rotating the pan halfway through the baking time. strata is done when the filling is set and the top turns a deep, golden brown.