Preheat the oven to 325 to 350°F
Coat an 8-inch pan with a bit of butter and caramel. If you don't have ready-made caramel, you can make one yourself by following step 2 of my classic chocolate flan recipe.
Place the 8-inch pan in a large roasting pan. Later, it'll serve as a water bath during the baking process.
To make the cake, you'll first need to beat butter and sugar together using an electric hand mixer until creamy. Once it’s light and fluffy, beat in the egg.
Mix the dry ingredients (flour, baking powder, baking soda, cocoa, and coffee powder) in a medium bowl.
Add in the buttermilk with the egg mixture and sift in the dry ingredients ⅓ at a time until well incorporated. If you don't have buttermilk, you can make a quick substitute by combining a tablespoon of white vinegar or lemon juice with a cup of milk. Alternatively, you can use plain yogurt.
Prepare the flan using the same steps in the classic flan de chocolate recipe mentioned above.
Scoop the cake batter into the caramel glazed pan evenly. Then, pour the flan mixture directly on top of the first layer. Shake gently to evenly distribute the batter in the pan. Afterward, cover the pan tightly with aluminum foil.
After adding about an inch or two of water to the roasting pan, gently put the choco-flan in the oven. Bake for about an hour or until the flan is firm to the touch. You can also insert a toothpick to make sure it's completely baked from the inside.
Remove the pan from the water bath and leave it to cool outside for about 30 minutes to an hour. Once completely cool, scrape the sides of the pan with a knife before flipping the pan over a large plate. Gently wiggle the pan until the flan chocolate cake slips out.
Garnish your dish with chopped pecans or nuts if desired and serve.