Melt the butter and vegetable oil in a large pan and add the onions, 3⁄4 of the thyme and a large pinch of salt. Cook very gently for 1 hour, stirring regularly, until the onions are really caramelised and jammy. Add the garlic and sugar for the final 15 minutes of cooking. Pour in the beef stock and add the Bovril, bring to the boil and season really well. Simmer for 30 minutes until reduced a little and the onions have melded with the stock.
Toast the sourdough slices on either side, then load up with the gruyère, remaining thyme and a good dash of Worcestershire sauce. Divide the soup between 4 ovenproof soup terrines or bowls, and heat the grill to high. Put the bread pieces on top of each bowl of soup and grill for 2-3 minutes until the cheese is bubbling.