To begin, melt butter in a saucepan over low heat. Stir in sugar and cocoa powder until smooth. Whisk the egg quickly into the mixture until it thickens slightly. Transition to combining with dry ingredients.
In a large bowl, mix biscuit crumbs, coconut, and walnuts. Pour in the chocolate mixture and stir until evenly coated. Move to pressing into a tin.
Line a square 20 cm tin with parchment. Press the mixture firmly and evenly into the base. Chill in the refrigerator for 20 minutes. Proceed to prepare the custard layer.
In a clean bowl, beat softened butter with custard powder and milk. Gradually add icing sugar until light, smooth, and spreadable. Move to layering over the base.
Spread the custard filling evenly over the chilled base with a spatula. Smooth the surface carefully for a neat finish. Refrigerate again for 20 minutes before adding chocolate topping.
Melt chocolate with butter in a heatproof bowl set over simmering water. Stir until glossy and smooth. Transition to pouring over custard.
Pour melted chocolate over the custard layer, tilting the tin gently to cover the surface. Avoid over-spreading to keep layers distinct. Refrigerate until firm, around 1–2 hours.
Using a sharp knife warmed under hot water, slice into squares or bars. Wipe the blade between cuts for clean edges. Transition to final presentation.
Arrange Nanaimo Bars on a plate or platter. Serve cold for the perfect bite of creamy, crunchy, and rich layers. Presentation tip: Pair with coffee or tea to balance the sweetness.