In a large pot, heat butter and olive oil over medium heat. Add sliced onions and sugar. Cook for 25-30 minutes, stirring occasionally, until onions are golden and caramelized.
Stir in white wine (if using) and scrape the bottom of the pot to deglaze. Add beef broth, thyme, salt, and pepper. Simmer for 20 minutes.
While the soup simmers, toast baguette slices under a broiler until golden on both sides.
Ladle soup into oven-safe bowls. Top each bowl with a toasted baguette slice and a generous amount of shredded Gruyère cheese. Broil until the cheese is melted and bubbly.
Garnish with fresh thyme if desired and enjoy hot.
Preparation Time: 10 minutes
Cooking Time: 50 minutes
Calories: Approx. 300 per serving
