In a large saucepan or Dutch oven, melt the butter and olive oil over medium heat.
Add the sliced onions, salt, and sugar. Cook, stirring frequently, for about 30-35 minutes until the onions are deeply caramelized and golden brown.
Sprinkle the flour over the caramelized onions and stir until well combined, cooking for an additional 1-2 minutes.
Pour in the white wine, scraping the bottom of the pan to deglaze and incorporate any browned bits. Allow to simmer for 5 minutes to reduce by half.
Add the beef broth and thyme, bringing the mixture to a boil. Reduce heat to low and let it simmer for about 10 minutes.
While the soup simmers, preheat the broiler. Toast the slices of baguette until golden brown on both sides.
Ladle the soup into broiler-safe bowls. Place a toasted slice of baguette on top of each bowl, and generously sprinkle with shredded Gruyère cheese.
Place the bowls under the broiler for 2-3 minutes, or until the cheese is bubbly and golden brown.
Carefully remove the bowls from the oven and let them cool slightly. Garnish with fresh parsley if desired, and serve hot.