In a large pot or Dutch oven over medium heat, melt the butter and olive oil together.
Add the sliced onions, sugar, and salt, stirring well. Cook the onions, stirring occasionally for about 15-20 minutes, until they are deeply caramelized and golden brown.
Sprinkle the flour over the onions and cook for another minute, stirring to combine.
Slowly pour in the white wine, scraping the bottom of the pot to release any stuck bits. Let it simmer for about 5 minutes.
Pour in the broth and add the thyme. Bring the soup to a simmer and let it cook for another 20 minutes. Season with pepper to taste.
While the soup is simmering, preheat your broiler.
Toast the baguette slices until they are golden brown.
To serve, ladle the soup into oven-safe bowls or crocks. Top each bowl with a slice of toasted baguette and sprinkle generously with grated cheese.
Place the bowls under the broiler for 2-3 minutes, or until the cheese is bubbly and golden brown. Keep a close eye on it to avoid burning.
Carefully remove the bowls from the oven and serve hot.