Preheat oven to 350°F (175°C) and line a 9×13-inch pan with parchment.
Melt butter and chocolate, then let cool slightly.
Stir in sugars, eggs, and vanilla.
Fold in flour, cocoa, and salt until just combined.
Bake 22–28 minutes and cool.
Cook milk, egg yolks, sugar, and butter until thickened; stir in vanilla, coconut, and pecans.
Spread topping on brownies and let set; optionally garnish.