Whisk the cornstarch and water together until fully dissolved. Combine with the raspberries, sugar, and lemon juice in a medium saucepan over medium heat. Stir, mashing the raspberries as they soften.
Bring to a boil and maintain for five minutes, stirring occasionally. Remove from heat and stir in the vanilla extract.
Cool the filling at room temperature for ten to fifteen minutes, then refrigerate for at least four hours until completely cooled and thickened.
Preheat the oven to 350 degrees Fahrenheit (177 Celsius). Grease three 9-inch cake pans, line with parchment rounds, and grease the parchment.
Whisk together the flour, cocoa powder, sugar, baking soda, baking powder, salt, and espresso powder in a large bowl.
In a separate bowl, combine the oil, eggs, and sour cream on medium-high speed. Add the buttermilk and vanilla extract, then beat until combined.
Pour the wet ingredients into the dry ingredients, add the hot water or coffee, and whisk on low speed until fully combined. Fold in the flour-coated chocolate chips.
Divide the batter evenly among the three prepared pans. Bake for twenty four to twenty six minutes, until a toothpick inserted in the center comes out clean. Cool completely in the pans.
For the buttercream, beat the softened butter on medium speed for two minutes until creamy. Add the confectioners' sugar, cocoa powder, heavy cream, salt, and vanilla extract. Beat on low speed for thirty seconds, then on high speed for one minute.
Place the first cake layer on a serving plate. Spread a quarter cup of buttercream on top, then pipe a thick border of buttercream around the edge using a piping bag with a large round tip.
Spread half the chilled raspberry filling inside the buttercream border. Repeat with the second layer, then top with the third layer.
Spread the remaining buttercream in a thin layer over the top and sides as a crumb coat, smoothing with a bench scraper. Refrigerate, uncovered, for thirty minutes to three hours.
For the ganache, place the chopped chocolate in a heatproof bowl. Heat the cream and raspberry liqueur until gently simmering, then pour over the chocolate and let sit for two to three minutes before stirring until smooth. Chill for thirty minutes to thicken.
Pour the thickened ganache onto the chilled cake and spread evenly with an icing spatula. Garnish with fresh raspberries if desired.