Preheat the oven to 180°C/Gas 4. Halve the tomatoes lengthways and place, cut side up, in a small shallow roasting tin. Trickle over 2 tbsp olive oil, season with a little salt and pepper and sprinkle over the thyme leaves. Roast for about 20 minutes, until the tomatoes have softened a little, but are still holding their shape. Set aside to cool.
Meanwhile, for the caramel, sprinkle the 50g sugar into a 20cm ovenproof frying pan and place over a medium heat, tilting the pan as the sugar begins to melt. As soon as the caramel turns a terracotta brown colour, take off the heat and stir in 50g butter and the balsamic vinegar (protect your hand with a cloth as the hot caramel is likely to splutter). If it hardens, stir over a medium-low heat until it melts again. Leave to cool.
Blanch the shallots in their skins in boiling water for 30 seconds. Drain, refresh under cold running water, then peel and trim the root ends. Halve the shallots lengthways.
Heat the remaining oil and butter in a large frying pan. Add the shallots with 1 tbsp sugar and sauté over a medium heat for 10 minutes until golden brown all over. Pour in the stock, bring to the boil and braise for 10 minutes, or until the shallots are tender and most of the liquid has cooked off. Using a slotted spoon, transfer the shallots to the cooled caramel, leaving behind any syrupy liquid. Leave to cool.
Roll out the pastry on a lightly floured surface to the thickness of a £1 coin and cut out a 23cm round, using a plate as a guide. Use the rolling pin to lift the pastry over the shallots in the pan, positioning it centrally. Tuck the edges down the side of the pan, enclosing the shallots. Refrigerate for 1–2 hours, or overnight if making in advance.
Preheat the oven to 200°C/Gas 6. Bake the tart for 30–35 minutes, or until the pastry is golden brown. Let stand for 5 minutes; meanwhile, warm the tomatoes in the oven.
Invert the tatin onto a large plate. Arrange the tomatoes and goat’s cheese on top, then drizzle over any tomato juices from the roasting tin. Garnish with thyme to serve.