01 - Preheat the oven to 400°F. Line a baking sheet with parchment paper.
02 - Heat butter and olive oil in a large skillet over medium-low heat. Add onions, salt, and sugar. Cook, stirring frequently, for 25 to 30 minutes until onions are deep golden and caramelized. Stir in thyme and black pepper during the last 5 minutes.
03 - While onions are cooking, unroll the puff pastry and cut into 6 equal rectangles. Place on the prepared baking sheet. Using a knife, score a 1/2-inch border around each rectangle, being careful not to cut through.
04 - Brush edges of each pastry rectangle with beaten egg.
05 - Divide caramelized onions evenly within the borders of each pastry rectangle. Top with crumbled goat cheese.
06 - Bake for 15 to 18 minutes until pastry is golden and crisp.
07 - Remove from the oven and sprinkle with fresh chives or parsley if desired. Serve warm or at room temperature.