Peel and thinly slice the onions uniformly, aiming for slices about ¼ inch thick. This helps them cook evenly and caramelize at the same rate.
Place a heavy-bottomed pot or Dutch oven over medium heat and add the butter, allowing it to melt and foam gently.
Add the sliced onions to the pot, stirring to coat them in the butter. Cook gently on medium-low heat, stirring every 8-10 minutes, until they soften and turn a deep golden amber—this can take about 45-60 minutes. The onions will smell sweet and smoky, and their texture will become sticky and glossy.
Once the onions are richly caramelized, pour in the white wine and stir, scraping up any browned bits from the bottom of the pan. Let the wine reduce slightly for about 2-3 minutes, intensifying the flavor.
Add the beef broth, thyme sprigs, and bay leaf to the pot. Bring the mixture to a gentle simmer, then reduce the heat to low. Let it simmer uncovered for 20-30 minutes, allowing the flavors to meld and the broth to thicken slightly.
Preheat your oven to 200°C (390°F). Arrange the baguette slices on a baking sheet and toast them until golden and crispy, about 8-10 minutes.
Remove the thyme sprigs and bay leaf from the soup. Ladle the hot soup into oven-safe bowls or a baking dish. Top each with a few slices of toasted baguette, then generously sprinkle grated Gruyère cheese over the bread.
Place the bowls on a baking sheet and broil in the oven until the cheese is bubbly and golden, about 3-5 minutes. Keep a close eye to prevent burning. The cheese should be melted and slightly crispy on top.
Carefully remove the bowls from the oven and let sit for 2 minutes to settle. Serve hot, enjoying the rich broth with the crispy, cheesy topping and toasted bread slices.