Preheat oven to 350°F. Lightly coat an (8-inch) square baking dish with cooking spray.
In a large bowl, whisk together flour, baking powder, salt, espresso powder, ¾ cup of the granulated sugar, and ¼ cup of the cocoa.
Whisk in milk, butter, and vanilla until a thick batter forms.
Spread batter evenly in prepared baking dish.
Whisk together brown sugar, remaining ¼ cup granulated sugar, and remaining ¼ cup cocoa; sprinkle evenly over batter in baking dish.
Pour hot water over mixture in baking dish, completely covering surface. (Do not stir mixture.)
Bake in preheated oven until center is set, about 40 minutes.
Remove from oven, and sprinkle with flaky sea salt. Let cool 15 minutes. Scoop into bowls; top evenly with ice cream. Garnish with caramel sauce and walnuts.
