Preheat oven to 220°C fan-forced. Line a baking tray with baking paper.
Place the puff pastry sheet on the tray. Score a 1cm border around the edge with the tip of a knife, not cutting all the way through.
Heat butter in a wide pan over high. Add mushrooms in a single layer, salt heavily. Do not stir for 3 minutes. Then stir, cook another 6 minutes until well browned.
Add garlic and thyme, cook 30 seconds. Drain mushrooms in a sieve to release residual liquid.
Spread mushrooms evenly over the pastry, inside the scored border. Scatter gruyère over.
Brush the pastry border with the egg wash.
Bake 22 minutes until the pastry is deeply golden and the cheese is bubbling.
Rest 4 minutes. Cut into squares. Serve with a leafy salad.