Preheat your oven to 350°F (177°C). Grease three 9-inch round cake pans and line each with parchment paper rounds, then grease the parchment paper as well. This helps the cakes release smoothly from the pans. (For guidance, you can refer to tutorials on making parchment paper rounds for cakes.)
To make the cake, whisk together the flour, cocoa powder, sugar, baking soda, baking powder, salt, and espresso powder (if using) in a large bowl and set aside. In a separate bowl, using a handheld or stand mixer fitted with a whisk attachment—or a manual whisk—combine the oil, eggs, sour cream, buttermilk, and vanilla extract until smooth. Pour the wet ingredients into the dry mixture, add the hot water or coffee, and whisk or beat everything together until the batter is fully combined.
Divide the batter evenly among the three prepared pans and bake for 21 to 25 minutes, watching closely as baking times may vary. The cakes are done when a toothpick inserted into the center comes out clean. Remove the pans from the oven and place them on a wire rack to cool completely while still in the pans.
While the cakes are cooling, prepare the coconut pecan filling. In a medium saucepan over medium heat, combine the butter, brown sugar, egg yolks, and evaporated milk. Whisk occasionally until the mixture reaches a low boil. Once boiling, whisk continuously until the mixture thickens, about 5 minutes. Remove from heat, then stir in the vanilla extract, toasted pecans, and shredded coconut. Allow the filling to cool fully—it will thicken further as it cools—so it’s ready for layering.
To assemble and frost the cake, first level the cake layers if needed by slicing off a thin layer from the tops using a large serrated knife. You can discard these trimmings or crumble them over ice cream. Place one cake layer on your cake stand, turntable, or serving plate, and spread half of the coconut pecan filling (about 1¼ cups) evenly over the top. Add the second layer and spread the remaining filling evenly on top. Place the third cake layer on top and cover it with a thick layer of chocolate buttercream. If desired, garnish with extra toasted pecans and shredded coconut. Refrigerate the cake for at least 45 minutes before slicing to help it set and prevent it from falling apart while cutting.
Store any leftover cake tightly covered in the refrigerator for up to five days.