Add the cubed chocolate and butter to a large mixing bowl and set aside.
Take a medium-sized pan and sift together the sugar, cocoa powder, cornstarch, and espresso powder.
Whisk together the milk, heavy whipping cream, and egg yolks in a separate bowl until thoroughly combined.
Pour about half a cup of the milk mixture into the pan with the dry ingredients. Mix until well incorporated, then add the remaining milk mixture and whisk until fully incorporated. It’s important not to add all the liquid at once, or the mixture will be lumpy.
Place the pan over medium heat, stirring continuously and often scraping the sides and bottom of the pan (you can use a rubber spatula). Heat until the mixture starts to thicken. Once it has a pudding consistency, take it off the heat immediately. If you cook it too long, the eggs in the mixture will start to scramble, and you will have lumps in your chocolate filling. If you still have lumps, strain the filling through a fine mesh strainer.
Pour the hot chocolate filling into the bowl with the chopped chocolate and butter. Let it sit for 1-2 minutes, then stir until the chocolate and butter are fully combined. Then add the vanilla extract.
Let the chocolate filling cool for about 20-30 minutes. Make sure you whisk the filling every few minutes to avoid a skin from forming.
Pour the chocolate onto the cream cheese filling and spread it into one even layer. Next, place a piece of plastic wrap directly on the surface of the chocolate filling to again, prevent a skin from forming during the cooling process.
Transfer the pie dish to the refrigerator to chill for at least 4 hours. I prefer to make it the day before and let it cool overnight.