Make the filling: Bring the milk to a simmer in a medium saucepan over medium heat. Whisk the sugar, cornstarch, vanilla and egg in a medium heatproof bowl until smooth. Gradually whisk half of the hot milk into the sugar mixture, then return to the pan with the remaining milk. Reduce the heat to medium low and cook, whisking constantly, until the mixture boils and thickens, 2 to 3 minutes. Transfer to a bowl (strain through a fine-mesh sieve if it looks lumpy), then stir in the chocolate until melted. Press plastic wrap directly onto the surface and refrigerate until cold, at least 1 hour.
Meanwhile, make the ganache: Put the chocolate and salt in a large heatproof bowl. Bring 1 1/2 cups heavy cream to a simmer in a saucepan over medium heat; pour over the chocolate and let sit 5 minutes, then whisk until smooth. Pour 3/4 cup of the ganache into a liquid measuring cup and set aside at room temperature. Refrigerate the remaining ganache in the bowl until thick but not set, about 1 hour.
Assemble the cake: Put 1 cake layer on a platter; spread the filling on top, stopping about 1/2 inch from the edge. Top with the second cake layer and press down gently.
Add the remaining 2 tablespoons heavy cream to the chilled ganache and beat with a mixer on medium speed until just fluffy, about 1 minute (do not overbeat). Frost the whole cake with the whipped ganache. Pour the room-temperature ganache on top, letting it drip down the sides. Let set before slicing, about 30 minutes.
Preheat the oven to 350 degrees F. Coat two 9-inch-round cake pans with cooking spray and line the bottoms with parchment paper.
Whisk the cocoa powder and 1 1/2 cups boiling water in a medium bowl until smooth; set aside. Whisk the flour, sugar, baking powder, baking soda and salt in a large bowl until combined. Add the eggs, vegetable oil, sour cream and vanilla and beat with a mixer on medium speed until smooth, about 1 minute. Reduce the mixer speed to low; beat in the cocoa mixture in a steady stream until just combined, then finish mixing with a rubber spatula. (The batter will be thin.)
Divide the batter between the prepared pans and tap the pans against the counter to help the batter settle. Bake until a toothpick inserted into the middle comes out clean, 30 to 40 minutes. Transfer to racks and let cool 10 minutes, then run a knife around the edge of the pans and turn the cakes out onto the racks to cool completely. Remove the parchment. Trim the tops of the cakes with a long serrated knife to make them level, if desired.
Recipe courtesy Food Network Magazine