01 - Preheat the oven to 400°F (200°C). Line a baking sheet with parchment paper and set aside.
02 - Melt the butter in a skillet over medium heat. Add the diced apples, brown sugar, cinnamon, nutmeg, and lemon juice. Cook for 6 to 8 minutes, stirring frequently, until the apples are tender and coated in a syrupy glaze. Remove from heat and allow to cool completely.
03 - In a mixing bowl, beat together the softened cream cheese, granulated sugar, and vanilla extract until smooth and creamy. Set aside.
04 - Unfold the puff pastry sheet onto a lightly floured surface and roll gently to smooth out any creases. Cut into 8 equal squares. Transfer the squares to the prepared baking sheet. Using a sharp knife, lightly score a smaller square border inside each piece about 1/2 inch from the edges, being careful not to cut all the way through. Prick the inner square several times with a fork to prevent excessive puffing.
05 - Spread a generous spoonful of the cream cheese filling onto the center of each pastry square, staying within the scored border. Top each with a heaping spoonful of the cooled apple mixture.
06 - Brush the exposed pastry edges with the beaten egg to promote even browning during baking.
07 - Bake on the center rack for 18 to 22 minutes, or until the pastry is deeply golden brown and fully puffed. Rotate the tray halfway through if needed for even coloring.
08 - Allow the danishes to cool on the baking sheet for 5 to 10 minutes. Whisk together the powdered sugar and enough milk or lemon juice to reach a drizzling consistency. Use a spoon to zigzag the glaze over the cooled danishes. Serve warm or at room temperature.