Heat the oven to 180C/160C fan/gas 4. Lay the squash slices on a baking tray and sprinkle over a little of the caster sugar. Bake for 20 mins or until the squash is still slightly resistant to a sharp knife, but not hard. Don’t overcook the squash, or it will break when you try to move it.
Meanwhile, scatter the rest of the sugar into an ovenproof frying pan about 20cm across, and heat it gently until it melts and starts to caramelise. Tip the pan if you need to combine patches of sugar that haven’t melted into the liquid parts, but don’t be tempted to stir. When you have a medium amber-coloured caramel, sprinkle on the spices and lemon juice. Turn the heat off.
Take the squash out of the oven and leave to cool for a couple of mins. Use tongs to place the squash in the frying pan, gently arranging the slices in a tight spiral on the caramel. Start with a large slice in the centre and lay the other slices on top so it looks neat when you turn it out. When the squash is all in the pan, turn the heat on again and cook until the caramel starts to bubble. Turn the heat down and cook for about 10-15 mins, making sure the caramel doesn’t burn. You want the squash to give off any water and then to start absorbing the caramel - the caramel will start to get very liquid as this happens, so turn the heat up at the end and make sure the caramel thickens up completely. Turn the heat off, drop the butter into the centre of the pan and wait for it to melt.
Cut the pastry into a rough circle just bigger than the pan and drape it over the squash, folding any excess over on itself and carefully tucking it in around the edge. Bake for 20 mins, then turn the heat down to 160C/140C fan/gas 3 and bake for a further 20 mins. Turn out onto a plate while the tarte is hot so the squash and caramel release easily. Serve with crème fraîche or ice cream.