Preheat the oven to 400°F (200°C).
In a large skillet, heat a tablespoon of oil over medium heat.
Add the onion and garlic to the skillet, cooking until soft and translucent.
Stir in the chopped mushrooms and thyme, cooking until mushrooms release liquids and soften.
Sprinkle flour over the mushroom mixture and stir to coat evenly.
Pour in the vegetable broth and stir, letting the mixture simmer until thickened.
Remove the skillet from heat and mix in the shredded Gruyère cheese until melted and combined.
Roll out the puff pastry on a lightly floured surface and cut into circles.
Place the pastry circles into mini pie dishes and fill with the mushroom mixture.
Top with additional pastry circles, sealing the edges by crimping with a fork.
Brush the tops with beaten egg for a golden finish.
Bake in the preheated oven for 20-25 minutes until golden brown.
Cool slightly before serving.