01 - Preheat the oven to 400°F. 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 thick syrup. Remove from heat and let cool completely.
03 - In a mixing bowl, beat the softened cream cheese, granulated sugar, and vanilla extract together until smooth and creamy. Set aside.
04 - Lightly flour your work surface and unroll the thawed puff pastry, smoothing out any creases with a rolling pin. Cut the sheet into 8 equal squares. Transfer the squares to the prepared baking sheet. Using a knife, lightly score a smaller square border inside each piece without cutting all the way through, then prick the inner center area several times with a fork.
05 - Spread a generous spoonful of the cream cheese filling in the center of each pastry square, staying within the scored border. Spoon the cooled apple mixture evenly over the cream cheese layer on each square.
06 - Brush the exposed pastry edges of each danish with the beaten egg to ensure a deep golden finish during baking.
07 - Bake on the center rack for 18 to 22 minutes, or until the pastry is puffed and deeply golden brown. Transfer to a wire rack and let cool slightly.
08 - Whisk the sifted powdered sugar with milk or lemon juice, one teaspoon at a time, until a drizzle-consistency glaze forms. Use a spoon to zigzag the glaze over the cooled danishes. Serve warm or at room temperature.