Butter and line a 9x9-inch baking pan with parchment, leaving overhang on two sides.
Combine the condensed milk, corn syrup, butter, and salt in a small saucepan over medium-high heat. Stir occasionally for the first minute until heated through.
Once steaming, whisk constantly but leisurely for 7 minutes it’s until pale golden and thickened. Do not let the base scorch.
Remove from the heat and whisk for 30 seconds. Cover and keep warm. If it thickens too much before use, reheat briefly on the stove.
Melt the butter and chocolate together in the microwave, or in a heatproof bowl set over a saucepan of barely simmering water, stirring until smooth. Remove from heat and cool for 5 minutes.
Whisk the sugar into the chocolate mixture until combined.
Mix the eggs together in a bowl and add them to the batter in three additions, whisking well after each. Add the vanilla. Whisk vigorously for 1 minute until the batter thickens slightly and turns glossy.
Fold in the flour, cocoa, and salt with a spatula until just combined. Stop as soon as no dry streaks remain.
Measure out ½ of the batter and pour it into the prepared pan, spreading it to the edges. Set aside the remaining batter.
Pour the caramel over the batter in an even layer (if it’s cooled and firmed, reheat it on the stovetop, stirring constantly). Do not spread it, pour it slowly to get as much coverage as possible.
Dollop the reserved batter randomly over the caramel. Use a skewer to spread the dollops just enough to cover the gaps. Do not drag deeply.
Bake for 30 to 35 minutes. The top should be set and matte; the center will still have a slight jiggle. Insert a toothpick into the corner away from the caramel layer; it should come out with moist crumbs, not wet batter.
Immediately sprinkle with 1 teaspoon of flaky salt.
Cool in the pan 10 minutes, then lift out using the parchment overhang.
Cool for a further 20 minutes before slicing. Cut with a hot, dry knife, wiping between cuts.