01 - Preheat oven to 400°F. Line a baking sheet with parchment paper and set aside.
02 - Melt butter in a skillet over medium heat. Add diced apples, brown sugar, cinnamon, nutmeg, and lemon juice. Cook for 6 to 8 minutes, stirring frequently, until apples are tender and coated in a thick syrup. Remove from heat and let cool completely.
03 - In a mixing bowl, beat softened cream cheese, granulated sugar, and vanilla extract together until smooth and creamy. Set aside.
04 - Unfold puff pastry on a lightly floured surface and roll gently to smooth out creases. Cut into 8 equal squares and transfer to the prepared baking sheet. Using a sharp knife, lightly score a smaller square border inside each piece without cutting all the way through. Prick the center area several times with a fork to prevent excessive puffing.
05 - Spread approximately one tablespoon of cream cheese filling in the center of each pastry square, staying within the scored border. Spoon a generous portion of the cooled apple mixture on top of the cream cheese layer.
06 - Brush the exposed pastry edges with beaten egg to promote even browning during baking.
07 - Bake on the center rack for 18 to 22 minutes, or until pastry is puffed and deep golden brown. Rotate the tray halfway through for even coloring if needed.
08 - Allow danishes to cool on the baking sheet for 5 minutes. Whisk powdered sugar with enough milk or lemon juice to reach a drizzle consistency. Use a spoon to zigzag the glaze over each danish. Serve warm or at room temperature.