Caramelize the onions: Heat 2 tablespoons olive oil, divided (1 tbsp) in a skillet over medium-low heat. Add the sliced onion and cook low and slow, stirring occasionally, until deeply golden and jammy about 30–40 minutes. Finish with 1 tablespoons balsamic vinegar, salt, and pepper. Stir and cook another 1–2 minutes until absorbed. Set aside.
Season the sweet potatoes: Toss sweet potatoes with the remaining 2 tablespoons olive oil, divided, 2 teaspoons fresh thyme, salt, and pepper until every slice is evenly coated. Slice thin, about ⅛ inch, so they cook through in the oven.
Prep the muffin tin: Preheat oven to 400°F. Grease a standard 12-cup muffin tin well. Cut the thawed 1 sheet all-butter puff pastry, thawed into 12 squares, large enough to drape into each cup with the edges coming up the sides to form little pastry cups. Press gently into each well.
Fill the cups: Spoon a layer of caramelized onions into the bottom of each pastry cup. Layer in a few sweet potato slices, then crumble 4 ounces goat cheese generously on top.
Egg wash and bake: Beat 1 egg, for egg wash and brush the exposed pastry edges of each cup. Bake at 400°F for 25–27minutes until the pastry is puffed and deeply golden and the sweet potato edges are just beginning to caramelize.
Rest and serve: Let the tarts rest in the tin for 5 minutes this helps them set so they lift out cleanly. Run a small offset spatula or butter knife around each cup to release, then transfer to a wire rack or serving board. Garnish with extra fresh thyme if desired.