Prepare the Soup Base: In a large Dutch oven or heavy-bottomed pot, heat the olive oil and butter over medium heat. Once the butter melts, add the sliced onions. Cook for about 10 minutes, stirring occasionally.
Caramelize the Onions: Sprinkle the onions with sugar to aid caramelization. Cook, uncovered, for 30 to 40 minutes, stirring frequently. Continue until the onions are deeply browned and soft, being careful not to scorch them.
Add Garlic and Deglaze the Pan: Stir in the minced garlic and cook for 1 minute. Add the sherry wine to deglaze the pot, scraping up any brown bits. Let the liquid reduce for about 3 minutes.
Simmer the Broth: Pour in the beef stock, add thyme sprigs, bay leaf, salt, and pepper. Stir well, partially cover, and simmer for 30 minutes to let the flavors meld. Remove the thyme sprigs and bay leaf before serving.
Prepare the Cheesy Croutons: Preheat your oven to 400°F. Brush both sides of the baguette slices with olive oil and arrange them on a baking sheet. Bake for 6 to 8 minutes, or until golden. Remove and set aside.
Add Cheese and Broil: Preheat the broiler. Top each toasted baguette slice with Gruyère cheese. Broil for 2 to 3 minutes until the cheese is bubbly and golden.
Assemble and Serve: Ladle the soup into bowls. Divide the cheesy croutons among the bowls, and sprinkle with additional thyme leaves. Serve immediately.