Caramelize the onions. In a large pot or Dutch oven, melt the butter over medium heat. Add the sliced onions and cook, stirring occasionally, for 25–30 minutes until deeply golden and caramelized.
Add aromatics. Stir in the minced garlic and cook 1 minute. Pour in the white wine to deglaze, scraping up the browned bits from the bottom of the pot.
Add flour. Sprinkle the flour over the onions and stir to coat. Cook 1–2 minutes to remove the raw flour taste.
Simmer. Slowly stir in the beef broth. Add the Worcestershire, thyme, and bay leaves, and season with salt and pepper. Bring to a simmer and cook 20–25 minutes.
Toast the bread. While the soup simmers, heat the broiler. Arrange the baguette slices on a baking sheet and toast until golden.
Broil and serve. Discard the bay leaves. Ladle the soup into oven-safe bowls, top each with a toasted baguette slice and a generous handful of Gruyère. Broil 2–3 minutes, watching closely, until melted and bubbly. Serve immediately.