Preheat the oven to 350º F. Lightly spray a 2-quart baking dish with cooking spray.: You will notice the kitchen warm slightly as the oven ramps to 350º F , and preheating ensures even baking and proper browning of the topping. Lightly spraying a 2 quart baking dish prevents sticking and helps the edges pull away cleanly, which also makes serving easier. If you skip preheating the oven the casserole can take longer to set and the topping may not crisp uniformly, so allow the oven to reach temperature before you start assembling. A common oversight is using a dish that is too large or too deep, which can change baking time and texture, so stick with a similar size for best results.
Add butternut squash to a large pot of salted water. Bring to a boil over high heat, then lower the heat to a simmer and cook until the squash is very tender, 15 to 20 minutes. Drain and cool. Mash the squash.: When the salted water comes to a rolling boil you will see steam and hear a steady rumble, and as the cubes simmer the squash softens and releases a sweet, earthy scent. Cooking until the squash is very tender is crucial because it determines the final mouthfeel, creamy rather than fibrous. After draining, allow the cubes to cool slightly so you can mash them without steam thinning the mixture. Use a potato masher or fork and aim for a smooth, slightly rustic texture with small pockets of squash for interest. If you undercook, the mash will be grainy and require more liquid to become smooth, so resist the urge to rush this step. One slip is overcrowding the pot which extends cooking time unevenly, so give those cubes room to boil gently.
Whisk together 4 tbsp butter, mashed butternut squash, milk, brown sugar, vanilla, salt, and eggs in a large bowl. Transfer to the prepared baking dish.: As you whisk, the mixture will take on a satiny sheen and a warm, sweet aroma from the brown sugar and vanilla . Whisking helps incorporate the eggs so the casserole sets uniformly and it blends the melted butter into the mash for richness. The texture at this point should be smooth and slightly loose, not thin or soup like, so adjust with a splash more milk only if necessary. Transfer into the prepared dish with a spatula, smoothing the top so the topping adheres evenly. A typical mistake is adding hot squash directly to eggs without tempering, which can scramble them, so mix gently and allow the mash to cool briefly if it is steaming.
For the topping: Combine the flour, brown sugar, 4 tbsp melted butter, and salt in a medium bowl until moist and the mixture clumps together. Stir in the pecans. Spread the mixture over the top of the butternut squash.: Combine the flour, brown sugar, 4 tbsp melted butter, and salt in a medium bowl until moist and the mixture clumps together. Stir in the pecans. Spread the mixture over the top of the butternut squash. : When the dry ingredients meet the melted butter they should form coarse, moist clumps that feel slightly tacky between your fingers. Stirring in the chopped pecans distributes their crunchy texture so each bite gets a nutty hit. Spread the topping evenly so it bakes uniformly and watch for areas that are too thick or too thin. The mixture should not be wet or greasy, if it is, you may have used too much butter or packed the sugar too tightly. A common mistake is overworking the topping until it becomes pasty, which prevents crisping, so handle it until just combined.
Bake for 25 to 30 minutes.: As the casserole bakes at 350º F , you will notice the aroma deepen and the topping will gradually turn golden brown and give off a toasty scent. The edges should bubble gently and the center will set so a small shake does not make it slosh. Baking until the topping is crisp and the filling is set creates the contrast that defines the dish. If you pull it out too early the center can be loose and the topping soft, so check for a lightly browned top and steady filling. One common error is opening the oven repeatedly which lengthens baking time and cools the oven, so try to make your checks brief and decisive.