Melt the butter in a large pot over medium heat.
Add sliced onions and sugar, stirring occasionally.
Cook until the onions become golden brown, about 25-30 minutes.
Add minced garlic to the pot and cook for another minute until fragrant.
Pour in the white wine, scraping any browned bits from the bottom of the pot.
Reduce the wine by half.
Add beef broth, bay leaf, and dried thyme to the pot.
Season with salt and pepper.
Bring the soup to a boil, then reduce heat to low and simmer for 30 minutes.
Preheat the oven’s broiler.
Pour soup into oven-safe bowls.
Top each bowl with a slice of French bread and a generous handful of Gruyère cheese.
Place bowls under the broiler until the cheese is bubbly and golden, about 3-5 minutes.
Remove carefully and serve hot.