Preheat oven to 220°C.
Heat oil in a medium saucepan over medium-high heat. Add the onion, garlic fennel, sugar and thyme, and cook, stirring regularly, for 5-6 mins until onion starts to caramelise.
Stir in the passata and bring to the boil. Stir in the parsley, reduce heat to low and simmer for 5 mins. Remove from the heat and gradually whisk in the butter. Season to taste. Spoon one-third of the sauce over the base of a 3L-capacity ovenproof dish.
Layer pumpkin over the sauce, then spoon over remaining sauce. Scatter with the cheeses. Cover with baking paper then foil. Bake for 1 hour, remove foil and baking paper and bake for a further 20-25 mins until pumpkin is cooked and top is golden.
Sprinkle over pepita seeds and extra thyme leaves. Stand for 15 mins before serving.