Preheat oven to 350°. Line a baking sheet with parchment paper.
To prepare pastry: On a lightly floured surface, unfold pastry sheet. Cut an 8-inch circle from pastry sheet. Place cut dough circle on prepared pan. Using a fork, prick dough every 1⁄2 inch to dock. Brush dough with beaten egg, and refrigerate until ready to use.
To prepare mushroom duxelle: In a large saucepan, melt butter over medium-high heat. Add cremini mushrooms, and cook until slightly wilted, 5 to 7 minutes. Reduce heat to low. Add shallot, 1⁄2 teaspoon thyme, salt, and pepper, and cook until moisture from the mushrooms has cooked out, 15 to 20 minutes. Set pan aside to let cool for 5 to 10 minutes. Place cooled mushroom mixture in the work bowl of a food processor. Cover and pulse until smooth. Coat pastry dough with a layer of the mushroom duxelle, leaving a 1⁄4-inch border. Bake until golden brown, about 20 minutes.
To finish: Immediately top baked pastry with Gruyère, sautéed beech mushrooms, remaining 1 teaspoon thyme, and black truffle or truffle oil. (You can also finish with high-quality olive oil and finishing salt to taste.) Slice into wedges and serve.