Preheat oven to 375°F. Grease a 9×13-inch baking dish.
Melt the butter. In a large bowl, combine melted butter, brown sugar, maple syrup, milk, cinnamon, nutmeg, vanilla, and salt.
Add sweet potato cubes to the bowl. Toss until every piece is coated.
Spread the mixture evenly in the prepared dish. Cover tightly with foil.
Bake for 25 minutes. Remove foil, stir gently, and sprinkle pecans over the top.
Bake uncovered 12–15 minutes more, until potatoes are tender and syrupy at the edges.
If using marshmallows, scatter on top. Bake or broil 2–4 minutes until lightly toasted.
Let rest 5 minutes before serving so the sauce thickens slightly.