Melt the butter in a large stockpot over medium-high heat. Add the fennel, onions, and thyme and saute for 20 to 25 minutes, until the onions and fennel are very tender and caramelized. (You can add a little water if it starts to stick.) Deglaze the pan by adding the brandy; reduce the heat to medium and cook for 3 minutes, scraping the bottom of the pan. Add the sherry and white wine and simmer, uncovered, for 10 minutes. Add the chicken stock, salt, and pepper and continue to cook, uncovered, for another 15 minutes. Add the Pernod and cook for 5 more minutes. Check for salt and pepper.
Preheat the broiler.
Ladle the soup into 6 to 8 ovenproof bowls and place 1 or 2 slices of French bread and a handful of Gruyère cheese on top of each bowl. Place the bowls on a baking sheet and slide them under the broiler for 3 minutes, or until the cheese is brown and bubbly, and serve.