Preheat the oven to 200C/400F/Gas 6.
Roughly slice the peppers, red onions and garlic and place on baking tray. Bake in the oven for approximately 30 minutes until soft and well browned.
Roll out the pastry into a rectangle about 25cm/10in x 20cm/8in.
Put the cooked vegetables down the middle of the pastry. Lay the cheese slices evenly down the middle. Scatter with small sprigs of thyme.
With a sharp knife, cut slits 3cm/1in apart, 1cm/½in away from the peppers mixture to the edge of the pastry, slanting away from you. Brush with beaten egg.
Starting at the end nearest to you, fold the pastry alternately over each other, to give a 'plait' effect. Brush the top with beaten egg.
Transfer to a baking tray and bake in the centre of the oven for 30 minutes, reducing the temperature to 150C/300F/Gas 2 after 20 minutes. Serve in slices hot or cold.