Make the filling: Melt the butter in a large heavy skillet over medium heat. Add the apples in an even layer, then the vanilla bean, lemon zest, lemon juice, and sugar. Cover and cook, stirring occasionally, until the apples are completely soft, 25 to 30 minutes. Remove the cover, increase the heat if necessary for the apples to be bubbling vigorously, and continue cooking, stirring frequently, until any liquid has evaporated and the thickened apple mixture moves around as a mass when you stir it, about 15 minutes. It may caramelize in spots, but watch it so it doesn't get too dark.
Preheat oven to 400 degrees F. Place a round of buttered parchment paper in the bottom of a 1-quart charlotte mold or ovenproof bowl with a flat bottom.
Prepare the crust: Cut about 4 slices of the bread in half to form triangles, and then cut those triangles in half. Brush 1 side of each triangle lightly with butter, and arrange them in the base of the prepared mold, buttered-side down, so they completely cover the bottom. If there are any spaces, fill them in with pieces of bread that are cut to fit.
Cut the remaining bread slices into 14 to 16 (1-inch) wide strips, and trim them so they are just long enough to reach the top of the mold. Lightly brush each with clarified butter, and arrange them, buttered-side out, upright along the sides of the mold to completely line it, overlapping them slightly. Set aside the extra bread strips.
Remove the vanilla bean from the apples and discard it. Spoon the apple mixture into the mold. The apples may mound above the edge of the mold; they will sink during cooking. Completely cover the apple filling with any remaining pieces of bread, cut to fit, buttered-side out.
Place the charlotte mold on a baking sheet, and bake it on the center rack of the oven for 15 minutes. Then reduce the heat to 350 degrees F, and continue baking until the bread on the top and sides is deep golden, about 35 minutes. If the top is getting too dark, cover it loosely with aluminum foil.
Transfer the charlotte mold to a wire rack and let it cool for 15 minutes. Then, place a serving plate over the top of the mold and carefully flip it over. The charlotte will slide right out. Because of its pudding-like consistency, use 2 large spoons to cut the charlotte. Serve it warm or at room temperature, with the custard sauce alongside.
Combine the milk and the vanilla bean, if using, in a medium-sized heavy saucepan over medium-high heat. Scald the milk by heating it just until little bubbles form around the edge of the pan. Remove the pan from the heat, cover, and set aside to infuse for 15 minutes.
Meanwhile, whisk the egg yolks and the sugar together in a medium bowl until pale yellow and thick.
Strain the hot milk into a bowl, and discard the vanilla bean. Whisk the milk into the egg yolk mixture, add the vanilla extract, if using, and return it to the saucepan. Cook, stirring constantly, over medium-low heat until the custard has thickened enough to coat the back of a spoon, 8 to 10 minutes. Be careful not to let the custard curdle.
Immediately transfer the custard to a bowl, to stop the cooking of the custard. Let it cool to room temperature, and then serve or cover and refrigerate. The custard will thicken in the refrigerator, and it will keep for 1 day.