Thinly slice the yellow onions, aiming for even slices about 1/8 inch thick.
In a large heavy-bottomed pot, melt the butter with the olive oil over low-medium heat, allowing the mixture to warm gently.
Add the sliced onions to the pot and stir to coat them evenly with the butter and oil. Cook slowly, stirring frequently so they soften evenly.
Continue cooking over low heat, stirring often, until the onions turn a deep amber color and smell sweet and smoky, about 45-60 minutes. Adjust the heat if necessary to prevent burning.
Once caramelized, pour in the white wine and deglaze the pot, scraping up any browned bits from the bottom. Let the wine cook off for about 5 minutes until mostly evaporated.
Add the beef broth and thyme sprigs to the pot. Bring the mixture to a gentle simmer and cook uncovered for 20 minutes to develop the flavors.
While the soup simmers, preheat your oven to 220°C / 430°F. Slice the baguette into rounds about 1/2 inch thick and toast them until golden and crispy, about 8 minutes.
Remove the thyme sprigs from the soup and season with salt and pepper to taste. Ladle the hot soup into oven-safe crocks or a baking dish.
Top each serving with a toasted bread round, then sprinkle generously with grated Gruyère cheese.
Place the dishes on a baking sheet and bake in the oven until the cheese bubbles and turns golden brown, about 10 minutes. For extra browning, broil for 2 minutes, watching carefully.
Remove from the oven, let sit for 2 minutes to cool slightly, then serve hot, enjoying the bubbling cheese and rich, caramelized onions in every spoonful.