Preheat the oven to 400°F (200°C).
Roll out the pie crust on a floured surface and transfer it to a baking sheet lined with parchment paper.
In a large skillet, melt the butter with the olive oil over medium heat. Add the sliced onions and cook until they start to caramelize, stirring occasionally for about 20 minutes.
Add the mushrooms to the skillet and continue cooking for another 5 minutes until they are softened.
Stir in the thyme leaves, salt, and black pepper. Cook for an additional 2 minutes.
Remove the skillet from the heat and stir in the balsamic vinegar. Allow the mixture to cool slightly.
Spread the caramelized onion and mushroom mixture evenly onto the rolled-out pie crust, leaving a border around the edges.
Sprinkle the grated Gruyere cheese over the top of the filling.
Fold the edges of the pie crust over the filling, pleating as you go.
Brush the exposed edges of the crust with the beaten egg wash.
Bake the galette in the preheated oven for 25-30 minutes, or until the crust is golden brown.
Remove from the oven and let it cool for a few minutes before serving.
Slice and serve the galette warm or at room temperature.