Melt the butter and oil together in a sauté pan over medium heat. Add the onions and a generous pinch of salt and stir, cooking until they are soft and translucent. Add the white wine, stir, cover the pan and cook for a few minutes, until the wine has evaporated. Pour in the water, add the brown sugar and 2 teaspoons thyme, stir well and cover. Cook for 5 – 10 minutes over medium-low until the onions are deep brown and jammy, stirring a few times to prevent scorching. You can add a little water if needed. Spread the onions evenly on the bottom of a small baking dish, about 6 inches in diameter and 2 inches deep.
Pulse the gruyere in a food processor until it is small crumbs. Scrape the rind from the brie, cut into chunks and add to the food processor with the cream cheese, milk, cornstarch and remaining thyme. Process until you have a thick paste with a little chunky texture. Spread the cheese over the onions in the baking dish to cover evenly. You can now cover the dish and refrigerate for up to two days.
When ready to bake, preheat the oven to 350° and bake until golden and bubbly and warm though, about 20 minutes. Let the dip rest for 5 minutes before serving.