Preheat the oven to 400°F (200°C) and line a baking sheet with parchment paper.
Heat the butter and olive oil in a large skillet over medium heat.
Add the mushrooms and cook for 6–8 minutes until they release their moisture and become lightly golden.
Stir in the shallot, garlic, salt, pepper, and thyme. Cook for another 1–2 minutes until fragrant.
Remove the filling from the heat and allow it to cool slightly.
Roll the puff pastry into a rectangle on a lightly floured surface and transfer it to the prepared baking sheet.
Lightly score the center third lengthwise without cutting through the pastry.
Cut 1-inch diagonal strips along both sides of the pastry.
Spoon the mushroom filling evenly down the center and top with shredded Gruyère cheese.
Fold the pastry strips alternately across the filling to create a braided pattern.
Brush the entire braid with beaten egg.
Bake the Mushroom Gruyère Puff Pastry Braid for 22–28 minutes until deeply golden, puffed, and crisp.
Let cool for 5–10 minutes before slicing and serving.