Make the cookie filling:
In a metal bowl set over a saucepan of simmering water, melt the bittersweet (or semisweet) and milk chocolate, stirring frequently with a rubber spatula to ensure even melting. In a small saucepan, heat the cream over medium heat to just below the boiling point. Remove the bowl of chocolate from the pan of water and wipe the bottom and sides dry. Pour the cream into the chocolate and stir with the spatula until very smooth. Stir in the hazelnut butter until well blended. Cover tightly with plastic wrap. Cool to room temperature and refrigerate until thick but not stiff, about 2 hours, stirring occasionally with the spatula. If you make the filling in advance and it has become very firm, leave it at room temperature until it reaches a nice spreading consistency.
Make the cookies:
In the bowl of a stand mixer using the paddle attachment (or in a large mixing bowl using a hand-held mixer), beat the butter until fluffy, about 2 minutes. Add the sugar and beat until well blended. Add the ground hazelnuts and mix well. Stop occasionally and scrape the sides and bottom of the bowl with a rubber spatula.
Add the egg yolks, one at a time, mixing thoroughly after each addition. Mix in the vanilla extract, and then add the flour in two or three batches, mixing to blend well, but don’t overmix. Divide the dough, shape into two thick disks, wrap in plastic, and chill until firm, about 3 hours. (If the dough isn’t thoroughly chilled, it will be too soft to roll out and cut.)
Adjust the oven racks to the upper and lower thirds of the oven and heat it to 375°F.
Line four baking sheets with parchment. Work with one disk at a time; leave the other in the refrigerator. Try to work in a cool area, not too close to the warm oven. Roll the dough between sheets of lightly floured waxed paper or parchment until it’s about 1/8 inch thick for sandwich cookies, 1/4 inch for single cookies.
Cut out shapes using a cookie cutter. To make a “window” in the top cookie, in half of the shapes, cut out the center using a smaller cutter. Put the cookies on the lined baking sheets, leaving at least 1/2 inch between each wafer. Gently press the scraps together, reroll, and cut more wafers. If the dough is too warm and hard to work with, return it to the refrigerator to chill.
Bake two sheets at a time (keeping the others in the refrigerator) for 7 minutes and then switch the sheets to the opposite racks. Bake for another 6 to 7 minutes, until deep golden on the top and the bottom. Keep a close eye on the baking time, and keep in mind that the cookie tops may be finished a minute earlier than the bottoms. Let cool on racks. The wafers must be cooled completely before assembling the cookies.
Use a small metal spatula or table knife to to spread some of the filling onto each wafer bottom. Place one of the wafer tops on top of the filling, pressing slightly so they stick together. Store the sandwich cookies at room temperature between layers of waxed paper, tightly covered with aluminum foil in a plastic container, for up to three days.
The wafers can be baked up to two days before assembly and held at room temperature, tightly wrapped in aluminum foil.