Melt butter and olive oil in a large pot over medium heat. Add onions and cook, stirring occasionally, until caramelized and golden brown, about 30-40 minutes.
Add sugar and cook for another 5 minutes. Deglaze the pot with sherry, scraping up any browned bits from the bottom.
Add beef broth, bay leaf, and thyme. Bring to a boil, then reduce heat and simmer for 30 minutes.
Preheat broiler. Place French bread slices on a baking sheet and broil for 2-3 minutes per side, until toasted.
Remove bay leaf from soup. Ladle soup into oven-safe bowls. Top each bowl with a slice of toasted French bread and sprinkle generously with Gruyère cheese.
Broil for 2-3 minutes, or until cheese is melted and bubbly. Serve immediately.