Heat a Dutch oven or another heavy pan over medium-high heat.
Add the olive oil and butter. When the butter has melted, add the onions, stirring to coat with the fat.
Reduce heat to medium-low, cover and cook for about 10 minutes to soften them and to help bring out some of the moisture, stirring several times.
Add the salt, bay leaf and fresh thyme. Leave uncovered, reduce heat to medium-low and continue cooking, stirring often so the onions brown evenly. Cook until the onions are a rich brown color, about 40-50 minutes more.
Add the garlic and cook briefly for approximately 30 seconds. Discard bay leaf and thyme sprigs.
Add the red wine, bring to a boil and cook 3-4 minutes or until almost evaporated.
Stir in the flour and cook for 1-2 minutes.
Add the beef broth, bring to a boil, reduce heat and simmer 8-10 minutes or until reduced slightly.
Adjust seasoning with salt and black pepper. Add the white wine or sherry, starting with 1 tablespoon. Add more to taste if needed. Keep warm.
Preheat broiler. Arrange the baguette slices on a baking sheet in a single layer. Top the bread with cheese. Broil until melted and beginning to brown, 1-2 minutes.
To serve, ladle into bowls and top with cheesy croutons. Alternatively, toast the bread at 325 degrees for 12-15 minutes, turning once. Place the croutons over the soup, sprinkle with cheese and broil briefly to brown the cheese. Serve immediately.