Peel and slice the onions. Make sure they are cut evenly.
In a large pot or Dutch oven, melt the butter with the olive oil over medium heat. Add the sliced onions and stir to coat them with the butter mixture. Cook for about 15 minutes, stirring frequently, until the onions start to soften and turn translucent.
Reduce the heat to medium-low and continue cooking, stirring occasionally, for about 30-40 minutes, or until the onions are deeply caramelized to a rich golden brown color. Add the garlic in the last few minutes of cooking, being careful not to let it burn.
Increase the heat to medium-high and pour in the white wine to deglaze the pot, scraping up any browned bits from the bottom with a wooden spoon. Let the wine reduce by half, which will take around 5 minutes.
Add the beef stock, bay leaves, and thyme. Season with salt and pepper. Bring the mixture to a simmer, then reduce the heat to low and let it gently simmer for about 30 minutes. This will allow the flavors to meld together. Remove the bay leaves before serving.
Preheat your broiler. Place the baguette slices on a baking sheet, top with grated cheese and broil them in the preheated oven until the cheese is bubbly and golden brown, about 2-3 minutes. Watch carefully to prevent burning.
Carefully remove the baguette from the oven and place them in the bowl of soup. Serve immediately.