Wash the tomatoes. Peel the shallots and cut them lengthwise into slices. Wash the rosemary, dab dry and remove the needles.
Heat 2 tablespoons of oil in a tarte tatin dish (24 cm Ø) or an ovenproof pan on the stove. Fry the shallots, rosemary and tomatoes briefly over a high heat, sprinkle with sugar. Then braise at medium heat for about 10 minutes. Season with salt, pepper and vinegar.
Take the puff pastry out of the fridge. Preheat the oven (electric cooker: 200 °C/circulating air: 180 °C/gas: see manufacturer). Pull the mould off the oven. If a lot of liquid has collected in the mould, carefully drain or skim off the liquid. Spread the tomatoes evenly in the mould again.
Roll out the puff pastry, prick several times with a fork. Place on the tomatoes and remove the baking paper. Carefully fold the excess dough towards the middle. Bake in a hot oven for 18-20 minutes.
Remove the tart from the oven and carefully turn it over onto a plate. Break or roughly pluck the mozzarella, place it on the tart and sprinkle with 1 tablespoon of oil.