Preheat the grill to high. Grill the peppers for 5-8 minutes, turning frequently, until the skin is blackened. Place in a bowl, cover with clingfilm and leave for 15-20 minutes, until cool.
Remove the skin and discard, wash off any bits, then slice the peppers into strips. Preheat the oven to 200°C, fan 180°C, gas 6.
In a pan, gently cook the onions in 1 tablespoon of the oil for 8-10 minutes. Turn up the heat, add the peppers and cook for 5 minutes. Remove from the heat. Unroll the pastry on a lightly greased baking sheet. Using a sharp knife, gently score a border 2cm from the edge of the pastry. Brush the border with the beaten egg.
Spoon the peppers and onions onto the pastry, keeping within the border. Place the cheese on top and sprinkle over the thyme. Drizzle over the remaining oil. Bake for 15 minutes, until the pastry is puffed up and the cheese is melted.