In a large pot or Dutch oven, melt 3 tablespoons of butter with 1 tablespoon of olive oil over medium heat.
Add the thinly sliced onions and cook for about 10 minutes until they are soft and translucent.
Sprinkle 1 teaspoon of sugar and 1 teaspoon of salt over the onions. Continue to cook, stirring frequently, for about 30-40 minutes until the onions are deeply caramelized and golden brown. Be patient, as this step is crucial for the flavor of the soup.
Add 2 cloves of minced garlic to the pot and cook for another minute. Pour in 1 cup of dry white wine to deglaze the pot, scraping up any browned bits from the bottom. Let the wine simmer until it is mostly evaporated.
Add 8 cups of beef broth, 2 bay leaves, and 1 teaspoon of dried thyme. Bring the soup to a boil, then reduce the heat and let it simmer for about 30 minutes. Season with salt and pepper to taste.
While the soup is simmering, preheat your oven to 400°F (200°C). Arrange the baguette slices on a baking sheet and toast in the oven for about 5-7 minutes, or until golden and crisp.
Remove the toasted baguette slices from the oven and sprinkle each slice with grated Gruyère cheese. Return to the oven for a few more minutes until the cheese is melted and bubbly.
Ladle the hot soup into oven-safe bowls. Place a few cheesy baguette slices on top of each bowl of soup.
Preheat your broiler. Place the bowls on a baking sheet and broil for 2-3 minutes, or until the cheese is melted and bubbly.