Melt butter in a large, heavy-bottomed pot over medium heat. Add onions and sugar, stirring to coat.
Cook onions for 40-45 minutes, stirring every 5 minutes, until deep golden brown and caramelized. This is the secret to amazing flavor, so don't rush it! Reduce heat if they're browning too quickly.
Add garlic and cook for 1 minute. Pour in wine and scrape up any browned bits from the bottom of the pot. Let it simmer for 2 minutes.
Add beef broth, bay leaves, and thyme. Bring to a boil, then reduce heat and simmer for 20 minutes. Season with salt and pepper to taste.
While soup simmers, preheat your broiler. Arrange baguette slices on a baking sheet and toast under the broiler for 1-2 minutes per side until lightly golden.
Ladle hot soup into oven-safe bowls. Top each with 1-2 toasted bread slices, then generously sprinkle with Gruyère and Parmesan cheese.
Place bowls on a baking sheet and broil for 2-4 minutes, watching carefully, until cheese is melted, bubbly, and golden brown on top.
Let cool for a minute or two (that cheese is molten hot!), then serve immediately. Warn everyone that the bowls are super hot!