Preheat the oven to 210c/450F. First make the ragu. Heat the oil in a medium sized frying pan or sauce pan and add the onion. Cook on a medium-low heat for 5 minutes, stirring occasionally, until the onion starts to soften. Add the garlic and cook for a further 1 minute.
Add in the tomato puree, oregano, sugar, tinned tomatoes, salt and pepper. Stir, bring to the boil, then simmer gently, stirring occasionally for 15 minutes. Turn the heat off.
Whilst the ragu is cooking, make the tart cases and bechamel. Unroll the pastry and put 6 x 10cm loose-bottomed tart tins to one side.
Cut the pastry into six squares - they should be bigger than the tart cases. Use the pastry to line the cases and push the pastry right into the grooves of the cases. Cut off excess pasty, but leave a bit of an overhang, as they will shrink back slightly during baking. Line each pastry case with a square of baking parchment, then add tbsp of uncooked beans/lentils/rice to each. Place on a tray in the oven for 10-12 minutes to 'blind-bake' until very lightly browned. This blind baking will ensure the pastry is fully cooked and not soggy later on.
Remove from the oven and carefully remove the beans/rice and baking parchment.
Now make the bechamel. Melt butter in a medium-sized saucepan. Add the flour and stir with a whisk to combine. It should form into a thick paste. Heat for 1 minute on a medium-high heat whilst stirring. Slowly add the milk, a bit at a time and whisk slowly after each addition to combine and remove any lumps. Continue to stir until the sauce is very thick, then stir in the cheddar, mozzarella and black pepper. Taste and add a little salt if you think it needs it.
Take your pastry cases, and brush beaten egg all around the rims. Spoon the tomato ragu into the pastry cases - two heaped tablespoons for each. Top each with two heaped tablespoons of the bechamel.
Arrange the sliced tomatoes on top, then sprinkle any gaps first with panko breadcrumbs, then with cheddar. Place in the oven and bake for 15-20 minutes until golden brown.
Remove from the oven and leave to cool for 5 minutes, then carefully remove from the tins. Top with fresh thyme sprigs and serve with a big green salad.