Heat butter and olive oil in a large pot over medium heat.
Add sliced onions, sugar, and salt. Cook for 40-45 minutes, stirring occasionally, until deep golden brown.
Add minced garlic and cook for 1 minute.
Pour in white wine, scraping the browned bits from the pot. Simmer until wine reduces by half (~3-4 mins).
Add beef broth, thyme, and bay leaf. Bring to a boil, then reduce heat and simmer for 20 minutes.
Toast baguette slices until crisp.
Preheat the broiler.
Ladle soup into oven-safe bowls.
Place a toasted bread slice on top of each bowl.
Sprinkle generously with Gruyère (and Parmesan, if using).
Broil for 2-3 minutes until cheese is bubbly and golden.
Let cool slightly before serving. Garnish with extra thyme if desired.