Heat a large frying pan or sauté pan until hot, add two tablespoons of olive oil, the onions, thyme and soft brown sugar. Fry for 10-15 minutes over a medium-low heat, or until softened and golden-brown, stirring occasionally so it doesn’t catch on the bottom.
Add the garlic and cook for a minute, then add the white wine and cook until the volume of liquid has reduced by half. Stir in the flour and cook for two minutes.
Add the brandy and sherry, then pour in the stock and bring to the boil. Reduce the heat slightly and cook gently for about 10-15 minutes.
While the soup simmers, heat a griddle until hot. Drizzle the remaining tablespoon of olive oil over the bread and toast on one side. Set aside.
Check the seasoning of the soup, adding plenty of salt, a little black pepper, and more sugar or alcohol if necessary to suit your own taste.
Preheat the grill to high.
Ladle the soup into bowls and top with the toasted bread. Add the cheese on top of the bread and grill until bubbling and golden-brown.