Preheat your oven to 350°F (175°C) and grease a 9x13-inch baking dish.
In a large pot, bring water to a boil and add the peeled and cubed sweet potatoes. Cook until tender, about 15 minutes. Drain the sweet potatoes and return them to the pot.
Add the pumpkin puree, granulated sugar, melted unsalted butter, beaten eggs, vanilla extract, ground cinnamon, ground nutmeg, salt, and whole milk to the pot with the sweet potatoes.
Mash the mixture until smooth and well combined. You can use a potato masher or an electric mixer for this step.
Sprinkle the all-purpose flour evenly over the sweet potato and pumpkin mixture. Stir until the flour is fully incorporated.
In a separate bowl, combine the brown sugar, chopped pecans, and melted unsalted butter. Mix until the ingredients are well combined and form a crumbly topping.
Transfer the sweet potato and pumpkin mixture to the greased baking dish and spread it evenly.
Sprinkle the pecan topping over the casserole, covering it completely.
Bake in the preheated oven for 25 minutes.
Remove the casserole from the oven and sprinkle the marshmallows evenly over the top.
Return the casserole to the oven and bake for an additional 10 minutes, or until the marshmallows are golden brown and toasted.
Remove from the oven and let the casserole cool for a few minutes before serving.