Heat the oven to 180 C / 350 F. Rub the butter over the bottom and sides of a 25 cm / 10-inch pie dish.
Scatter half the sliced almonds over the buttered dish, then arrange the raspberries in a single layer across the bottom.
In a mixing bowl, whisk the eggs and sugar together for about 1 minute, until pale and slightly frothy.
Whisk in the milk, cream, vanilla extract, and almond extract until smooth.
Sift the almond flour, all-purpose flour, and salt over the egg mixture. Whisk gently until no lumps remain, then let the batter rest for 10 minutes.
Pour the batter slowly over the raspberries, then scatter the remaining sliced almonds over the top.
Bake for 35 to 40 minutes, until the edges are puffed and golden and the center wobbles slightly but doesn't slosh when the dish is shaken.
Cool in the dish for at least 10 minutes before slicing, so the custard has time to firm up.
Dust with powdered sugar right before serving, if using, and slice into wedges.