Preheat the oven to 220C/200C fan/Gas 7 and line two large roasting tins with baking paper.
Put a mixture of the aubergines, red peppers and courgettes in each roasting tin in a single layer. Drizzle over 4 tablespoons of the oil and season well with salt and ground black pepper. Roast for about 25 minutes, or until lightly browned and just soft. Set aside to cool and reduce the oven temperature to 200C/180C Fan/Gas 6.
While the vegetables are roasting, heat the remaining oil in a large saucepan. Add the onions and fry over a medium-high heat for 2â€“3 minutes, or until soft. Add the garlic and fry for a further minute. Tip in the passata and season with the sugar and some salt and ground black pepper. Bring to the boil, then cover with a lid. Lower the heat and simmer for about 10 minutes, or until the onions are soft and the sauce has reduced and thickened. Add the basil.
Spoon half the sauce into the base of the ovenproof dish and arrange half the roasted vegetables in a spiral pattern on top, then season with salt and ground black pepper and sprinkle over the cheese. Spread the rest of the sauce over the cheese, and then arrange the remaining vegetables and the tomato wedges in a spiral pattern on top.
Sprinkle with the thyme, cover with foil and bake in the oven for 25 minutes or until bubbling. Cut into slices to serve.