On a lightly floured surface, roll out pastry dough.
Cut puff pastry dough into a circle measuring about ¾ inch larger in diameter than the pan. You can also leave the dough square or rectangular in shape, making sure it will fit in the pan that you’re using. Place on parchment paper and in fridge to cool.
Preheat oven to 350°F.
Heat a cast iron skillet or oven safe pan over medium heat with 2 tablespoons oil. Add the shallots, cut-side up, making sure you have enough to cover the base. Cook for 3-4 minutes and sprinkle the brown sugar.
Gently flip the shallots over, keeping them intact. Arrange the shallots so there are no gaps.
Turn down the heat to low, add balsamic vinegar and brandy, add thyme leaves and rosemary
Let shallots caramelize for about 5-8 minutes and sprinkle with salt and pepper.
Place the chilled pastry over the pan and carefully tuck the edges into the pan.
Bake for 25-30 minutes until puff pastry is golden.
Remove from oven and let rest for 3 minutes, then take a serving plate and place over pan. Flip the pan over on the serving plate.
Sprinkle with remaining fresh thyme and serve.