Blend the pastry chunks with half the walnuts in a food processor, roll out on a floured surface, and line a 23cm tart tin. Chill for 30 minutes.
Boil salted water, cook potatoes until tender, drain, and dry on kitchen paper.
Sauté onions in butter until soft, caramelize slightly, then remove. Add pears with a knob of butter and cook until lightly golden.
Whisk together egg, cream, milk, thyme, and seasoning, keeping in mind the cheese’s saltiness.
Preheat the oven to 200°C/fan 180°C/gas 6. Blind bake the pastry with foil and baking beans for 15 minutes, remove the beans, and bake for another 10-15 minutes until golden. Reduce oven to 180°C/fan 160°C/gas 4.
Fill the tart with caramelized onions, pears, potatoes, remaining walnuts, and most of the cheese. Pour over the egg mixture.
Top with the rest of the cheese and thyme, then bake until set but slightly wobbly in the center.
Serve warm or at room temperature and enjoy!