Preheat the oven to 220°C and line two roasting tins with baking paper.
Arrange aubergines, peppers, and courgettes in roasting tins.
Drizzle with 4 tablespoons of oil, season, and roast for 25 minutes.
Set vegetables aside and reduce oven temperature to 200°C.
Fry onions in remaining oil for 3 minutes until soft.
Add garlic for 1 minute, then stir in passata, sugar, and seasoning.
Simmer sauce for 10 minutes until thickened and stir in basil.
Layer half the sauce, half the vegetables, and all the cheese in the dish.
Top with remaining sauce, remaining vegetables, and tomato wedges in a spiral.
Sprinkle with thyme, cover with foil, and bake for 25 minutes.