In a large pot, melt the butter with the olive oil over medium heat. Add the sliced onions, fennel, and a pinch of salt. Cook for 25-30 minutes, stirring occasionally, until the vegetables are deeply caramelized and golden brown. Reduce the heat if needed to prevent burning.
Add Garlic and Deglaze:
Stir in the minced garlic and cook for 1 minute. Add the white wine, scraping the bottom of the pot to release any browned bits. Simmer for 2-3 minutes to reduce slightly.
Simmer the Soup:
Add the beef or chicken stock, thyme, and bay leaf. Bring to a boil, then reduce the heat and simmer uncovered for 20-25 minutes. Remove the bay leaf and season with salt and pepper to taste.
Prepare the Bread and Cheese:
Preheat the broiler. Place the baguette slices on a baking sheet and toast under the broiler for 1-2 minutes per side, until golden. Top each slice with grated Gruyère cheese and return to the broiler until the cheese is melted and bubbly.
Assemble and Serve:
Ladle the soup into ovenproof bowls. Place a cheese-topped baguette slice on each bowl, or float the croutons directly on the soup. Broil for 2-3 minutes, until the cheese is golden and bubbling. Serve immediately.