01 - Preheat the oven to 400°F.
02 - Place the potatoes in a large pot, cover with salted water, and bring to a boil. Cook until fork-tender, about 15–20 minutes. Drain well.
03 - Mash the potatoes with milk, butter, Parmesan cheese (if using), salt, and pepper until creamy and smooth. Set aside.
04 - While the potatoes cook, heat olive oil in a large skillet over medium heat. Add onion and cook for 3 minutes. Stir in leeks and garlic; cook for another 3–4 minutes until softened.
05 - Add mushrooms, carrots, and celery. Sauté until mushrooms are browned and vegetables are tender, about 8–10 minutes.
06 - Sprinkle flour over the vegetables and stir well to coat. Cook for 1 minute.
07 - Gradually add vegetable broth, stirring to prevent lumps. Pour in heavy cream, soy sauce, and thyme. Simmer until thickened, about 5 minutes.
08 - Season filling with salt, pepper, and parsley. Remove from heat.
09 - Spoon the mushroom and leek filling into a 9x13-inch baking dish. Spread the mashed potatoes evenly over the top.
10 - Use a fork to create ridges on the potato surface for extra crispiness. Bake for 25–30 minutes, or until the top is golden brown and the filling is bubbling.
11 - Let rest for 10 minutes before serving.