Place an oven rack in the center position and preheat the oven to 400°F (200°C). Thaw the puff pastry in the refrigerator according to package directions so it stays cold but is easy to unfold.
Peel the onions and trim off the tops, leaving the root ends attached. Cut each onion in half from top to root to get 12 neat halves, and discard any loose outer layers that could burn.
Set a 10 inch oven safe skillet over medium heat and melt the butter. When it foams, sprinkle the sugar evenly over the bottom and cook for 2 to 3 minutes without stirring, swirling gently, until light amber.
Carefully pour in the balsamic vinegar, which will bubble up quickly, and stir for about 30 seconds until glossy. Stir in the thyme, kosher salt, and black pepper, then remove the pan from the heat for a moment.
Place the onion halves cut side down in the caramel, starting at the outer edge and working toward the center. Pack them tightly and tuck in small wedges to fill any holes so the base looks like a mosaic.
Return the skillet to medium heat and cook the onions uncovered for about 10 minutes without moving them, until the cut sides turn deep golden brown.
Add the water around the edges of the pan, cover tightly with a lid or foil, and reduce the heat to medium low. Steam for 8 to 10 minutes until a knife slides easily into the thickest part of an onion.
Remove the lid and cook for 2 to 3 more minutes until most of the liquid reduces to a thick, syrupy caramel. Take the skillet off the heat and let it cool for about 5 minutes.
Lightly dust a clean work surface with flour, unfold the pastry, and gently roll it into an 11 inch square. Cut out an 11 inch round and prick it all over with a fork so steam can escape.
Lay the pastry round gently over the warm onions, tucking the edges down the inside of the skillet with a spoon or your fingertips. Press lightly so the pastry touches the onions with no big air pockets.
Place the skillet on a rimmed baking sheet and bake in the center of the oven for 25 to 30 minutes, until the pastry is puffed, deeply golden, and crisp with thick caramel bubbling around the edges.
Remove the skillet from the oven and let the tart rest for 10 minutes so the caramel thickens slightly and does not run everywhere when you flip it.
Run a thin knife around the inside edge of the skillet to loosen any stuck caramel. Place a large serving plate upside down over the skillet, hold both firmly with oven mitts, and flip in one quick, confident motion.
Lift the skillet away slowly and nudge any onions that stayed behind back into place. Scatter the crumbled goat cheese over the top, add fresh thyme sprigs, and finish with flaky sea salt. Slice into 6 wedges and serve warm.