Put the flour in a mixing bowl, and add the butter and ½ tsp fine salt. Rub gently with your fingertips until the mixture resembles fine breadcrumbs, or blitz in a food processor. Stir through the herbs, lemon zest and cheddar. Beat the egg yolk with 50ml cold water, add to the bowl and mix until it forms a dough. Add more water, 1 tsp at a time, until it comes together into a smooth dough. Wrap and chill in the fridge while you make the filling.
Heat the oven to 180C/160C fan/gas 4. Toss the squash pieces with 1 tbsp olive oil and some seasoning. Tip onto a baking tray and roast for 25-30 mins until golden and tender. Leave to cool.
Meanwhile, put the cloves of garlic in a saucepan, cover with cold water and bring to a simmer. Cook for 2-3 mins, then drain. Wipe the pan dry, add the garlic back in with 1 tbsp olive oil and fry on a high heat for 2 mins until golden. Add the balsamic vinegar and 100ml boiling water, bring back to the boil then turn down and simmer for 10 mins.
Add the honey, most of the rosemary and thyme and a good pinch of salt. Continue to cook on a medium heat for a further 3-5 mins, or until most of the liquid has evaporated and the garlic cloves are coated in a dark syrup.
Tip the cooled squash into a bowl and add the cheese, crème fraîche, lemon juice, mustard, parsley, a splash of Worcestershire sauce and the beaten eggs. Add a good pinch of salt and black pepper and gently fold in the garlic cloves.
Roll out the pastry on a work surface dusted with flour to 3-4mm thick. Line a 23cm-diameter springform or loose-based cake tin with the pastry, ensuring a little spills over the edges (the pastry is quite short – you can patch up when lining the tin, if needed). Pour the filling into the pastry case.
Pat the drained beans dry using kitchen paper and dress with a little olive oil, most of the lemon zest and a good pinch of salt, then scatter over the squash filling. Finish with the reserved rosemary and thyme, the sage, and a drizzle of olive oil. Bake for 1 hr-1 hr 10 mins or until the filling has set and the beans have popped and are crisp. Trim the edge of the pastry to neaten.
Remove from the oven and leave to cool a little (about 20 mins), then take it out of the tin. Scatter the remaning lemon zest and more herbs on top and serve warm. Leftovers are great cold, too.