In a saucepan, combine apples, sugars, cinnamon, nutmeg, and lemon juice. Cook over medium heat 8–10 minutes until apples soften.
Mix cornstarch with 2 tbsp water and add to the apples. Cook 2–3 minutes until thick and glossy. Stir in vanilla and butter, then let cool completely.
Preheat oven to 375°F (190°C). Roll out one pastry sheet and place on a lined baking tray. Spread the cooled apple filling evenly, leaving a small border.
Cover with the second pastry sheet and seal the edges with a fork. Brush with beaten egg and lightly score the top.
Bake 30–35 minutes until golden brown and flaky.
Cool slightly, slice into bars, and dust with powdered sugar (optional).
