Peel, core and quarter the apples.
Using a 9-inch (23 cm) flat-sided cake pan, tart dish or cast iron skillet as a template, cut a circle out from the puff pastry. Using a fork, poke holes all over to provide ventilation. Set aside.
Preheat the oven to 375°F (190°C).
In a large saucepan over low heat, distribute the sugar evenly and cook until light amber in colour, stirring to help melt any lumps, 5-7 minutes.
Add vegan butter, stirring constantly until the colour is a creamy light brown.
Add the apples, stirring until they are coated in a thick layer of caramel. Cook for about 15-20 minutes.
Remove from the heat when the caramel has reduced and little remains in the bottom of the pan. Be careful not to burn the caramel, tasting it from time to time to ensure it does not taste bitter. Add vanilla extract at this point if using.
Arrange the apple slices in concentric circles on the bottom of the cake pan. Press the apples tightly against each other, then pour the remaining caramel over the top.
Lay the circle of puff pastry on top. Tuck the puff pastry down the sides of the pan.
Bake for 45-50 minutes, until the pastry is golden brown and firm.
Cool for at least 1 hour, then invert onto a plate.
Slice and serve with vanilla ice cream.