Grease a 7cm-deep, 9 x 25.5cm (base measurement) loaf pan.
Place the gelatine leaf in a bowl of cold water. Set aside for 5 minutes or until soft. Squeeze out excess water. Place in a large heatproof jug with the jelly crystals. Add the boiling water. Stir to dissolve the crystals. Add the cold water. Stir well. Pour over the base of the prepared pan. Place in the fridge for 2 hours or until set.
Meanwhile, for the cream layer, place the gelatine leaves in a bowl of cold water. Set aside for 5 minutes or until soft. Combine the cream and sugar in a small saucepan and place over medium heat. Cook, stirring, for 2 minutes or until the sugar dissolves and the cream is warm. Squeeze out the excess water from the gelatine. Add to the cream mixture. Stir until smooth and combined. Set aside to cool slightly. Whisk in the mascarpone until smooth. Carefully pour the cooled cream mixture over the set jelly layer. Place in the fridge for 1-2 hours or until set.
For the custard layer, place the gelatine leaves in a bowl of cold water. Set aside for 5 minutes or until soft. Whisk the custard powder and sugar in a small saucepan until combined. Gradually whisk in the milk until smooth. Place over medium heat. Cook, whisking frequently, for 3-5 minutes until the mixture boils and thickens. Squeeze out the excess water from the gelatine. Add to the custard mixture. Stir until smooth and combined. Cover the surface of the custard with plastic wrap and set aside to cool.
Carefully pour the cooled custard mixture over the set cream layer. Cut the madeira cake into 1.5cm-thick slices. Cover the custard layer with the cake slices, trimming to fit (you may not need all of the cake). Drizzle the cake with the sherry. Cover and place in the fridge overnight or until set.
Dip the loaf pan into hot water for 10 seconds to loosen the slice and turn out onto a serving plate. Decorate with raspberries, if you like.
