Preheat the oven to 200°C / 180°C fan / Gas 6. Line a baking tray with baking paper.
Mix the ground almonds, sugar, almond extract and lemon zest. Gradually add enough beaten egg to form a firm, slightly sticky paste that holds its shape. You may not need all the egg. If the filling feels too soft to shape, refrigerate for 15–30 minutes.
Unroll the pastry, keeping it on its backing paper. Shape the almond filling into a log approximately 30 cm long and place it lengthways along the pastry, leaving at least 3 cm clear at each end.
Wrap the pastry around the filling, allowing the long edges to overlap by about 2 cm. Trim away any excess pastry to avoid a thick layer underneath. Lightly moisten the overlapping edge with water and press to seal.
Seal the ends and tuck them underneath. Transfer the roll to the prepared tray, placing it seam-side down.
Brush the top and sides with beaten egg. If desired, lightly score a diagonal pattern across the surface without cutting through the pastry. Scatter over the flaked almonds and press them gently into the glaze. Sprinkle with sugar, if using.
Bake for 25–30 minutes, until well risen and golden brown. If the almonds begin to brown too quickly, cover loosely with foil towards the end of cooking.
Leave to cool on the tray for at least 20 minutes before slicing, allowing the filling to firm up.