Melt the butter in a large pot over medium heat. Add onions, garlic, bay leaves, thyme and salt and pepper and cook until onions are very soft and caramelised, about 25min.
2
Add sherry, bring to a boil, reduce the heat and simmer until the sherry has evaporated and the onions are very dry, about 5min.
3
Discard the bay leaves and thyme springs. Dust the onions with the flour and give them a stir.
4
Turn the heat down to medium low so the flour doesn’t burn, and cook for 10min to cook out the raw flour taste. Now add the beef broth, bring the soup back to a simmer, and cook for 10min. Season to taste with salt and pepper. Preheat the oven.
5
Arrange the baguette slices on a baking sheet in a single layer. Sprinkle the slices with the cheese and broil until bubbly and golden brown, 3-5min. Ladle the soup in bowls and float several of the cheese baguette on soup.