Preheat your oven to 180ºC/gas mark 4. Set out a circular ovenproof dish about 15cm in diameter (or 4 small dishes).
Chuck the red onion wedges into the baking dish, drizzle with olive oil, season with salt and pepper, then roast for about 25 minutes until softened and cooked. Remove from the oven and allow to cool.
Meanwhile, lay out your sheet of puff pastry and cut out a circle 30cm in diameter. If you want to make 4 individual portions, cut out 4 smaller circles that will line the dishes with a 5cm overhang.
Add a squeeze of balsamic glaze to the onions, along with some thyme, then place the pastry on top and tuck in the sides. Brush with beaten egg if you want a professional finish and then bake in the oven for about 25 minutes until golden brown.
To serve, invert the tart onto a plate or serving board.