In a large skillet, heat the olive oil and butter over medium heat. Add the sliced onions and sprinkle with salt.
Cook the onions, stirring occasionally, for about 20-25 minutes until they are soft and caramelized. Add sugar and thyme, stirring well for an additional 5 minutes. Remove from heat and let cool slightly.
Roll out the puff pastry on a floured surface to fit into a tart pan. Gently press it into the pan, trimming any excess.
Spread the caramelized onions evenly over the pastry shell.
In a bowl, whisk together the eggs, heavy cream, salt, and pepper until combined. Pour the egg mixture over the onions.
Sprinkle the grated Gruyère cheese evenly on top.
Bake in the preheated oven for 30-35 minutes or until the tart is golden brown and the filling is set.
Remove from the oven and let cool for a few minutes before slicing.
Notes
Serve warm, garnished with fresh thyme sprigs, on a wooden board. You can also add a side salad for a refreshing contrast!