In a large pot or Dutch oven, heat the butter and olive oil over medium heat.
Add sliced onions, sugar, salt, and pepper to the pot. Cook, stirring frequently, for about 15-20 minutes until the onions are soft and caramelized.
Stir in the thyme and cook for another minute.
Pour in the white wine (if using) and scrape the bottom of the pot to deglaze, allowing the wine to reduce for about 5 minutes.
Add the beef broth and bring the soup to a simmer. Let it cook for an additional 20 minutes.
While the soup is simmering, preheat your broiler. Toast the slices of bread until golden brown.
To serve, ladle the hot soup into oven-safe bowls, top each bowl with a slice of toasted bread, and sprinkle generously with Gruyère cheese.
Place the bowls under the broiler for 2-3 minutes, or until the cheese is melted and bubbly. Keep a close eye on them to prevent burning.
Serve hot, garnished with fresh parsley if desired.