Preheat the oven to 190°C (375°F).
Skin and debone the duck legs, then shred the meat. Set aside in the fridge.
Put the potato and squash cubes in a pot. Cover with water and add salt. Bring to a boil, then put the lid on and simmer for 15 to 20 minutes, until tender. Drain well and mash. Mix in the melted butter and hot milk. Add salt and pepper.
Meanwhile, melt the butter for the sauce in another saucepan over medium heat. Sauté the shallots for 1 minute.
Add the balsamic vinegar, maple syrup and duck stock. Bring to a boil, then simmer for 10 to 12 minutes over medium heat until the sauce has reduced by two-thirds. Strain the sauce if desired.
In a large skillet, heat the oil over medium heat. Cook the mushrooms for 4 to 5 minutes.
Add the spinach to the skillet and cook for 1 minute, stirring.
In a bowl, mix the duck meat with 60 ml (1/4 cup) of the sauce.
Place a round cookie cutter or ramekin on a baking sheet lined with parchment paper. Fill the cookie cutter with a quarter of the duck meat. Cover with a quarter of the mushroom mixture, then a quarter of the mashed potatoes and squash. Repeat to form the other three servings.
Bake for 20 to 25 minutes.
Heat the remaining sauce for a few minutes.
Remove the duck parmentiers from the oven. Unmold gently with a small knife. Garnish each serving with walnuts. Serve with the sauce.