Roast the sweet potatoes at 400°F for 50 to 60 minutes, or until very tender when pierced with a knife. Let cool until easy to handle, then peel and mash until mostly smooth.
2 pounds sweet potatoes
Preheat the oven to 375°F and butter a 2-quart baking dish.
4 tablespoons unsalted butter
Whisk together the mashed sweet potatoes, melted butter, milk, brown sugar, vanilla, salt, cinnamon, nutmeg, and eggs until smooth and well combined.
½ cup whole milk, ⅓ cup packed dark brown sugar, 2 teaspoons vanilla extract, ½ teaspoon ground cinnamon, ¼ teaspoon ground nutmeg, 2 large eggs, ½ teaspoon kosher salt
Spread the sweet potato mixture evenly into the prepared baking dish.
Mix the chopped toasted pecans, brown sugar, melted butter, vanilla, cinnamon, and salt in a medium bowl until the pecans are evenly coated.
1½ cups chopped pecans, ½ cup packed brown sugar, 4 tablespoons unsalted butter, 1 teaspoon vanilla extract, ½ teaspoon ground cinnamon, ¼ teaspoon kosher salt
Sprinkle the pecan mixture evenly over the sweet potato filling.
Bake for 30 to 35 minutes, or until the filling is set around the edges and the topping is bubbling and lightly caramelized.
Rest the casserole for 10 minutes before serving.