Preheat your oven to 375°F and line two baking sheets with parchment paper. Slice 4 oz of mushrooms into 1/4″ slices and set them aside.
In a food processor, pulse the shallot and the remaining 4 oz of mushrooms until finely chopped, about 15 times.
Heat oil in a medium skillet over medium-low heat. Add the shallot mixture and season with salt. Cook until light brown and most of the liquid evaporates, about 15 minutes. Transfer to a bowl and let it cool slightly.
Add Gruyère, heavy cream, sour cream, cornstarch, and thyme to the mushroom mixture and mix until combined.
On a lightly floured surface, lay the pastry flat and cut it into 12 (3″) squares. Place 2 slices of reserved mushrooms on parchment on a prepared sheet, top with 1 tbsp. filling, and cover with a pastry square. Press around the edges to enclose. Repeat with the remaining tartlets, spacing them about 2″ apart.
Bake until the pastry is puffed and golden brown, about 15 to 20 minutes. Let them cool slightly, then invert onto a wire rack to cool completely.
**Make Ahead:** The filling can be made 3 days ahead and stored in an airtight container in the fridge. Puff pastry squares can be cut a day ahead. Simply place them on a parchment-lined sheet, wrap tightly with plastic wrap, and refrigerate.