Preheat the oven to 375°F (190°C).
- Roll out the pie crust and fit it into a tart pan. Trim any excess dough and prick the bottom with a fork. Bake the crust for about 10-12 minutes until lightly golden. Remove from the oven and set aside.
- In a skillet, heat olive oil over medium heat. Add chopped onion and garlic, and sauté until softened, about 5 minutes.
- Add the sliced mushrooms and cook until golden brown, about 8–10 minutes. Season with salt, pepper, and thyme. Set aside to cool.
- In a bowl, combine pumpkin puree, heavy cream (or coconut cream), egg, nutmeg, and salt and pepper. Whisk until smooth.
- Stir in the sautéed mushroom mixture. Add Parmesan cheese if using.
- Pour the pumpkin and mushroom mixture into the pre-baked tart crust. Smooth the top.
- Bake for 30–35 minutes or until the filling is set and slightly golden on top.
- Cool slightly before slicing. Serve warm or at room temperature, garnished with fresh thyme if desired.