Soak the raisins and heat the oven. Put the raisins in a small bowl, pour over the rum or apple juice, and leave them for 10 minutes. Heat the oven to 180°C (350°F), rack in the middle. Butter a snug baking dish that holds the four apples close together, about 20 × 30 cm.
Toast the almonds. Tip the sliced almonds into a small dry pan over medium heat. Cook 3 to 4 minutes, stirring, until golden and fragrant. Tip them straight onto a plate — they keep browning in the hot pan — and leave them to cool.
Core the apples, keeping the base closed. Wash the apples and dry them. Cut a thin slice off the top of each one to make a lid and set the lids aside. Remove the core with an apple corer or a small sharp knife, making a wide hole, about 3 cm across, but stop before the bottom — the base must stay closed, or the filling leaks out. Score a shallow ring through the skin around the middle of each apple so it can expand instead of splitting. If an apple wobbles, trim a sliver off the base so it stands straight. Brush the cut tops with lemon juice.
Mix the filling. Pinch off four hazelnut-sized pieces of marzipan and set them aside — these are the plugs. Crumble or grate the rest into a bowl. Add the toasted almonds, the raisins with any rum or juice left in their bowl, the brown sugar and the cinnamon. Work it together with your fingers into a crumbly mixture that holds together when squeezed.
Plug and fill the apples. Press one marzipan plug firmly into the bottom of each apple — it seals the hole even if the coring went a little deep. Spoon the filling in with a teaspoon, pushing it down with a wooden spoon handle so there are no air pockets, and let a little mound sit on top. Set the apples close together in the dish, put a small piece of butter on each, and pour the apple juice around them, not over them.
Bake until soft and wrinkled. Bake 30 to 40 minutes, depending on the size and variety of your apples. Halfway through, spoon some juice from the dish over them. They are done when the skins are wrinkled and starting to split and a knife slides in with no resistance. Put the lids on for the last 10 minutes for soft lids, or leave them off for colour. Do not bake past soft — the apples collapse into sauce.
Make the vanilla sauce while the apples bake. Whisk the egg yolks, sugar, cornstarch and vanilla in a bowl until smooth. Warm the milk in a small saucepan until steaming but not boiling. Pour it slowly into the yolks, whisking all the time, then pour everything back into the pan. Cook over low heat, stirring constantly, for 3 to 4 minutes until the sauce coats the back of a spoon. Never let it boil — it turns into sweet scrambled egg. Take it off the heat at once.
Rest, then serve warm. Let the apples stand for 5 minutes — the filling is very hot. Lift each apple into a shallow bowl, spoon the pan juices over it, and pour the warm vanilla sauce around it. Add a scoop of ice cream if you like, and a few toasted almond flakes.