Slice the yellow onions thinly and set your stove to medium-low heat. Melt the butter in a heavy-bottomed pot, then add the sliced onions and a pinch of salt. Cook slowly, stirring often, until the onions turn a deep golden brown, about 45-60 minutes, filling your kitchen with a sweet, smoky aroma.
Pour in the white wine and scrape up the browned bits from the bottom of the pot. Allow the wine to reduce by half, about 3-4 minutes, releasing a fragrant, slightly tangy scent.
Add the beef broth, a sprig of thyme, and the bay leaf. Bring the mixture to a gentle simmer, cover partially, and cook for 20 minutes, allowing the flavors to meld and deepen into a rich, layered broth.
While the soup simmers, slice the bread into 1/2-inch thick pieces and toast them on a baking sheet at 200°C (400°F) until golden and crisp, about 8-10 minutes.
Remove the thyme sprig and bay leaf from the broth, then taste and adjust seasoning as needed. Ladle the hot soup into ovenproof bowls, then layer the toasted bread slices on top of each serving.
Sprinkle a generous layer of shredded Gruyère cheese over the bread, then place the bowls under the broiler or on the oven's grill setting until the cheese is melted, bubbly, and golden, about 2-4 minutes. Keep a close eye to prevent burning.
Remove the bowls from the oven and let them rest for a couple of minutes. Serve hot, enjoying the cheesy, caramelized aroma and velvety broth in every spoonful.