Caramelize the onions in butter and olive oil over medium-low heat, stirring frequently until deeply golden.
Add mushrooms and cook until tender, then stir in garlic and thyme.
Deglaze the pot with white wine, scraping up any browned bits from the bottom.
Sprinkle flour over the mixture and stir to coat, then slowly add beef broth and a bay leaf.
Simmer for 20–30 minutes to let the flavors develop. Season with salt and pepper.
Toast the baguette slices under the broiler until golden brown.
Ladle soup into oven-safe bowls, top each with a toasted baguette slice and grated Gruyère.
Broil until the cheese is bubbly and golden, then serve immediately.