Remove the ice cream from the freezer and let it soften at room temperature for about 30 minutes until it's spreadable but not melted. Line a 9x13 inch baking dish with parchment paper, allowing some overhang on the sides for easy removal later. Once softened, spread the ice cream evenly across the prepared dish in a single, uniform layer. Place in the freezer for at least 2 hours until completely firm—this creates a solid base for your sandwich.
Preheat your oven to 350°F. In a medium bowl, whisk together the flour, sifted cocoa powder, baking powder, salt, and espresso powder (if using)—sifting the cocoa removes lumps and ensures even distribution. In a separate large bowl, beat the softened butter and granulated sugar together for about 3 minutes until light and fluffy, which incorporates air and creates a tender cookie. Add the room-temperature eggs one at a time, beating well after each addition, then mix in the vanilla extract and milk until fully combined.
Gently fold the dry ingredient mixture into the wet ingredients until just combined—overmixing develops gluten and can make the cookies tough. Line a 9x13 inch baking sheet with parchment paper and spread the dough evenly across it to match the dimensions of your ice cream layer. I like to use an offset spatula for this as it distributes the dough uniformly and prevents gaps. Bake for about 10 minutes until the cake is set but still slightly fudgy in the center—it will continue cooking slightly as it cools and should be tender enough to layer with ice cream without cracking.
Remove the baked cookie sheet from the oven and let it cool on the counter for about 30 minutes. While still slightly warm, use a sharp knife or bench scraper to cut the cookie into two 9x13 inch pieces (you can do this directly on the parchment). Once completely cooled, carefully transfer one cookie layer to the top of the frozen ice cream layer using the parchment paper overhang from Step 1 to help lift it if needed.
Working quickly to prevent the ice cream from melting, place the second cooled cookie layer on top of the ice cream, pressing gently to create an even sandwich. I recommend having everything prepped and ready before you start assembly so you're not fumbling around while the ice cream softens. Cover the assembled sandwich with plastic wrap or foil and place it back in the freezer overnight—this allows the layers to fuse together and makes slicing much cleaner.
Remove the ice cream sandwich from the freezer and let it sit at room temperature for just 2-3 minutes to soften slightly—this prevents the cookie from cracking when you cut. Using a sharp, warm knife (dip it in hot water and wipe dry between cuts for cleaner slices), cut the sandwich into individual rectangles of your desired size. Serve immediately while still cold, or wrap individual sandwiches in parchment and store in the freezer for up to a week.