Place puff pastry dough in the fridge overnight to thaw.
Marinate the mushrooms for one hour or overnight. Do not marinate for longer than 24 hours, or the mushrooms could become mushy.
Over medium-high heat, heat 2 tablespoons olive oil in a large skillet.
When the olive oil is hot, add the marinated mushrooms. Sauté until tender and browned, which will take approximately 5-7 minutes. Remove from heat, transfer to bowl, and set aside.
Slice off both ends of onions, remove papery outer layers, and cut lengthwise from tip to root. Next, cut each half across the middle to create four sections. Cut each of the four sections lengthwise into strips. (Be careful not to cut the onions too thin; this will cause them to burn while cooking.)
Melt butter in a large skillet with high sides over medium heat. (Do not use a non-stick pan if possible.)
Add onions and use a wooden spoon to stir and coat them with butter.
Cook onions for approximately 45-50 minutes. Stir every five minutes to help them cook evenly and ensure they don’t stick to the pan.
Once the onions have reached your desired caramelization, deglaze the pan with white wine. Add enough liquid to allow you to scrape up the brown bits. Add salt and pepper to the onions to taste, and then remove them from the heat and let them cool in the pan. When they’re cool, transfer any unused onions to an airtight container.
Next, preheat oven to 375 degrees. Using parchment paper, line two large, rimmed baking sheets. Set these aside.
Using thawed puff pastry dough, cut it in half and roll it out onto a lightly floured surface. Take a pizza cutter or sharp knife and cut the first batch into 32 equal rectangles.
Transfer rectangles to the prepared baking sheet and freeze for 10 minutes. Repeat this process for the second batch of puff pastry.
Remove puff pastry sheets from the freezer and allow them to sit for a few minutes. Then, brush each piece with beaten egg.
Arrange equal amounts of cheese, onions, and mushrooms on each puff pastry piece. Sprinkle fresh thyme leaves on top.
In the preheated oven, place baking sheets and bake puff pastry bites for 10-15 minutes before rotating each sheet to ensure even cooking.
Continue cooking until the pastries have turned a golden brown color, which will take approximately 8-10 additional minutes. Remove from oven, allow them to cool, and serve!