Line two standard baking sheets with parchment paper. Set aside.
In the bowl of a stand mixer fitted with a paddle attachment, beat butter, sugar, and brown sugar until combined.
Add the egg and vanilla and beat to combine.
With the mixer turned off, add the flour, salt, baking powder, cinnamon, ginger, and baking soda. Beat until a smooth dough forms.
Wrap the finely grated carrots in a paper towel and squeeze out any excess juice.
Stir carrots into the batter, along with the coconut, ¼ cup walnuts, and raisins until evenly distributed.
Scoop 2 tablespoon-sized mounds onto baking sheets, spacing apart. You should have 24 cookies total.
Top half (12) of the mounds with remaining ¼ cup walnuts, pressing to adhere.
Bake the cookies for 8 to 10 minutes, or until they are firm to the touch. Set aside to cool.
Prepare the frosting: In the bowl of a stand mixer fitted with a paddle attachment, beat butter, cream cheese, vanilla, and salt until smooth.
Gradually add in the confectioners' sugar and beat until smooth.
Transfer frosting to a piping bag and cut a small hole at the top.
Once cookies are completely cool, line up bottoms and tops to create sandwiches, flipping the bottom cookies (the ones without extra walnuts) over to serve as the bases.
Pipe frosting onto the bottom cookies.
Place the top cookies onto the frosted bottom cookies, forming sandwiches.
Prepare optional glaze: In a small bowl, mix confectioners' sugar and milk until smooth.
Add orange food coloring to the glaze as desired.
Drizzle the glaze over the carrot cake cookies before serving. Otherwise, refrigerate the cookies until ready to serve.