Peel and thinly slice the onions, making sure the slices are even. This helps them caramelize uniformly and prevents some pieces from burning while others are undercooked.
In a large Dutch oven, melt the butter with the olive oil over medium heat. Stir in the onions, coating them well. Cook for about 15 minutes, stirring often, until they soften and turn translucent.
Lower the heat to medium-low and keep cooking for 30–40 minutes, stirring occasionally, until the onions are a rich, golden brown. Stir in the garlic in the last few minutes.
Turn the heat back up to medium-high and pour in the white wine. Use a wooden spoon to scrape up all the flavorful bits stuck to the bottom of the pan. Let the wine reduce by about half, which takes around 5 minutes.
Add the vegetable stock, bay leaves, and thyme. Season with salt and pepper. Bring to a gentle simmer, then reduce the heat and let it cook for about 30 minutes. Remove and discard the bay leaves before serving.
Preheat your broiler. Arrange the baguette slices on a baking sheet, top each with grated cheese, and broil for 2–3 minutes until the cheese is bubbling and golden. Watch carefully so it doesn’t burn.
Carefully place the cheesy baguette slices on top of bowls of hot soup. Serve immediately and enjoy the comforting flavors.