Preheat the oven to 200°C (fan-assisted). Heat the oil and butter in a pan. Gently cook the onions for 15–20 minutes until soft and caramelized. Add the balsamic vinegar, thyme, salt, and pepper, and stir to combine.
Mix the crème fraîche, mustard, black pepper, and thyme together.
Place the pastry on a baking tray lined with baking paper. Using a knife, score a 2cm border around the edge, taking care not to cut all the way through the pastry.
Spread a thin layer of the mustard-crème fraîche mixture over the pastry, staying within the border. Top with the caramelized onions, apple slices, and grated Cheddar.
Brush the edge of the pastry with the beaten egg. Bake for 20–25 minutes until the pastry is golden and crisp, and the cheese is bubbling. Sprinkle with fresh thyme and a little coarsely ground black pepper before serving.