Preheat the oven to 350 degrees F.
For the croutons: Combine the oil and garlic in a jar. Cover and shake well. Brush the garlic olive oil on all sides of the bread cubes. Place the cubes on a baking sheet and bake until crunchy, 20 to 25 minutes.
For the caramelized onions: Place a large soup pot over medium heat and add the olive oil, red onions and a small pinch salt. Stir to separate the rings and coat with oil. Cook until the onions become translucent, and then turn the heat down to medium-low and saute, stirring often, until reduced to half their size and are dark brown, soft and sweet, 30 minutes.
For the soup: Pour the red wine into the onion pot to deglaze. Add beef stock, thyme and bay leaf. Stir and simmer for 30 minutes. Add the lentils, Cognac, some sea salt and pepper to taste. Remove the bay leaf and simmer for another 5 minutes.
Preheat the oven to broil.
Ladle the soup into 4 stoneware soup bowls and top with a layer of croutons. Sprinkle with the grated Gruyere and broil in the oven until the cheese is golden brown and bubbling, about 10 minutes.