Cook sweet potatoes: Place cubed sweet potatoes in a large pot of salted water. Boil until fork-tender, about 15–20 minutes. Drain well.
Mash potatoes: Transfer to a large mixing bowl and mash until smooth.
Mix base: Add melted butter, brown sugar, milk, eggs, vanilla, cinnamon, nutmeg, and salt. Stir until fully combined.
Assemble casserole: Spread the sweet potato mixture evenly into a greased 9x13-inch baking dish.
Add topping: Sprinkle mini marshmallows (and pecans, if using) evenly on top.
Bake: Bake at 350°F (175°C) for 20–25 minutes, until marshmallows are golden and bubbly.