Mix the horseradish sauce in a large bowl with the thyme and half the cream. Add the leek and all but 2 tablespoons of the walnuts and mix well.
Cut the pumpkin into chunks, discarding the skin and seeds. Thinly slice the chunks.
Scatter half the potatoes in a 2 litre (3½ pint) shallow, ovenproof dish, seasoning lightly with salt, and cover with half the pumpkin chunks. Spoon the leek mixture on top, spreading in an even layer. Arrange the remaining pumpkin slices on top and then the remaining potato slices. Sprinkle with salt.
Mix the remaining cream with the stock and pour over the potatoes. Mix the breadcrumbs with the butter and sprinkle over the top. Scatter with the pumpkin seeds and remaining nuts. Cover with foil and bake in a preheated oven, 180°C (350°F), Gas Mark 4, for 1 hour. Remove the foil and bake for a further 45–60 minutes until golden and the vegetables feel tender when pierced with a knife.