Heat butter and olive oil in a large pot over medium heat.
Add sliced onions and cook until softened, about 10 minutes.
Stir in sugar to help caramelize the onions, cooking for another 20 minutes until golden brown.
Pour in the white wine and scrape the bottom of the pot to deglaze.
Add beef broth and thyme, season with salt and pepper.
Bring to a simmer and cook for 30 minutes.
Preheat the oven to 350°F (175°C).
Ladle the soup into oven-safe bowls and top with baguette slices.
Sprinkle Gruyère cheese generously over the bread.
Bake in the oven for 15 minutes or until the cheese is bubbly and golden.