Melt the butter in a large heavy-bottomed pot, over medium heat. Add the onions, garlic, thyme, bay leaves, salt and pepper. Stir and cook until soft and translucent, and just beginning to caramelize, about 10 to 15 minutes.
Stir in the red wine, making sure to scrape up the browned bits at the bottom of the pot. Cook until the red wine has evaporated, about 10 minutes. Remove and discard the bay leaves and stir in the flour. Cook for about 10 minutes to cook off that raw flour taste. Stir in the beef stock. Cover, bring to a boil, reduce heat to low and simmer for about 10 minutes.
Ladle the soup into 6 oven safe bowls or ramekins. Place two slices of bread on top of each soup bowl. Sprinkle each with cheese and then place on a baking sheet. Pop the baking sheet under the broiler until the bread has toasted and the cheese has melted. Garnish with fresh thyme before serving.