Preheat the oven to 350°F (175°C). Grease and flour three 9-inch cake pans (or two pans and 12 cupcake tins).
In a double boiler or heatproof bowl set over simmering water, melt the dark chocolate and butter. Stir in the chocolate stout until smooth.
In a stand mixer, beat the sugar, eggs, and egg yolks until light and fluffy (about 3 minutes). Add the canola oil and sour cream and continue mixing until fully combined.
Gradually add the melted chocolate mixture, scraping the sides to ensure everything is incorporated.
In a separate bowl, whisk together the flour, baking powder, espresso powder, cocoa powder, and kosher salt. Slowly add the dry ingredients to the wet ingredients, mixing until just combined.
Pour the batter evenly into the prepared pans. Bake at 350°F for 20-25 minutes, or until the cake springs back when lightly touched. (Bake cupcakes for 15-17 minutes.)
Allow the cakes to cool in their pans for 10 minutes before transferring them to a wire rack to cool completely. For best results, chill the cake layers for 1 hour before frosting.
For the frosting: In a stand mixer, beat the softened butter until creamy. Add the sour cream and beat until light and fluffy.
Gradually add the melted chocolate chips, then the confectioners sugar, mixing until smooth.
Slowly add the bourbon and heavy cream, mixing until fully incorporated. Refrigerate the frosting for 20-30 minutes to set before applying to the cake.
Once the cake layers are cooled and chilled, frost the cake, spreading an even layer of frosting between the layers and on top.
