Make the apple pie filling: In a large mixing bowl, add diced apples, lemon juice, pie spice, and sugar. Toss to coat apples and combine.
Cook apples: In a large pan, over medium heat, melt the butter. When the butter has melted, add the coated apples to the pan and cook, stirring frequently, until the apples begin to caramelize and appear glossy (10 to 15 minutes). If the butter dries up, add a splash of water and continue cooking.
Add cornstarch: In a small bowl, mix together a teaspoon of water and corn starch. If the pan is dry, add a teaspoon or two more of water. Then, add the corn starch mixture. Stir well.
Finish and cool: Bring the apple pie filling to a boil, cook for an additional 30 seconds to 1 minute to activate the cornstarch, and then stir in the vanilla. Transfer mixture to a bowl and let cool completely.
Preheat and prep baking sheet: Preheat the oven to 350 degrees F. Line two baking sheets with parchment paper and set aside.
Mix dry ingredients: In a medium mixing bowl, add almond flour, flour and salt. Whisk well to combine. Set aside.
Mix wet ingredients: In the bowl of an electric mixer, add butter, sugar, almond extract and vanilla. Mix until smooth and well combined..
Mix almond shortbread cookie dough: To the bowl with the wet ingredients, add the dry ingredient mixture and mix on low until the flour is just incorporated and the dough forms. Do not overmix.
Shape cookies: Using a rounded tablespoon, shape the dough into rounded balls and place on the prepared baking sheet, leaving at least an inch in between each ball. Press your thumb into the center of each ball of dough, creating a well for the apple pie filling. If the dough cracks, just gently press it back together.
Bake and finish cookies: Transfer the baking sheet to a preheated 350-degree oven and bake for 18 to 24 minutes or until the dough has been set but not yet browned. Allow the cookies to cool completely before filling each well with apple pie filling. Dust with powdered sugar (optional) and enjoy.