In a medium bowl, sift together flour, cornstarch, baking powder, and baking soda. Set aside.
Using a hand mixer, beat butter and sugar on medium speed until light and fluffy, about 3 minutes. Beat in egg yolks and vanilla extract just until combined. Reduce speed to low. Add the flour mixture and beat just until combined. Do not overmix or the cookies will turn out tough.
Form the dough into a ball, then flatten slightly to form a disc. Wrap with plastic wrap and refrigerate for 1-2 hours, until firm enough to roll.
If you don’t want to use the dough right away, you can refrigerate it for up to 3 days or freeze it for up to a month, then thaw it overnight in the fridge.
The dough is going to look like sand... this is normal. You will know that your dough is not too dry when you can squeeze a handful of dough in your palm and it retains its shape.
Take the dough out of the fridge and let it sit on the counter for a few minutes to soften slightly for easy rolling. On a lightly floured surface (or between 2 pieces of parchment paper), roll the dough to a 1/8 or 1/4-inch (3-5mm) thickness. Cut out into rounds using a 2-inch (5cm) fluted or round cookie cutter, and place the cookies on baking sheets lined with parchment paper. You may need to add a bit of water to the dough to ensure that it sticks to itself when rolling. ONLY add enough water to make the dough combine. Do not add too much or your cookies will lose their shape in the oven.
If at any point the dough becomes too warm, place it back into the fridge for a few minutes. Re-roll the remaining scraps and repeat. Place sheets with cookies in the freezer or fridge for at least 15 minutes, until firm, so that they will be less prone to spreading.
Preheat oven to 350F/180C. Bake for 10-12 minutes, or until cookies appear golden brown at the edges (mine took about 15 minutes). Allow cookies to cool in the pan for 10 minutes, then gently transfer to a wire rack to cool completely.
Spread the bottom half of the cookies with dulce de leche (about a teaspoon). Sandwich together with remaining cookies, pressing slightly so that the caramel oozes out the sides. If desired, roll the sides in shredded coconut.
Store cookies at room temperature in an airtight container for up to a week or freeze for up to 2 months. To thaw, leave on the counter, still covered, or overnight in the fridge.