Cook the onions
Place a large skillet over medium-low heat and melt the butter with the olive oil. Add the sliced onions, salt, pepper, sugar, garlic powder, and thyme. Stir now and then as they cook low and slow for 20 to 25 minutes, until they turn soft and richly golden.
Pour in the broth and stir well. Let the onions cook for 5 minutes more, until they become silky and almost jam-like. Take the pan off the heat and set aside.
Tip: Slow cooking gives the onions their best flavor and sweetness.
Get the potatoes ready
Heat the oven to 375°F (190°C). Butter a 9x13-inch baking dish.
Add the sliced potatoes to a large bowl. Pour in the cream, then season with salt, pepper, and fresh thyme. Toss until the slices are evenly coated.
Build the casserole
Layer half of the potatoes in the prepared dish. Spoon half of the caramelized onions over the top. Scatter ½ cup of Gruyère and ¼ cup of Parmesan over that layer.
Repeat with the rest of the potatoes, the remaining onions, and the remaining cheese. Drizzle any extra cream left in the bowl over the top.
Bake
Cover the dish tightly with foil and bake for 40 minutes. Remove the foil and continue baking for 20 minutes, until the potatoes feel tender and the top looks melted and golden.
For a more browned, crisp finish, place it under the broiler for 2 to 3 minutes at the end.
Finish and serve
Let the bake stand for 5 minutes before serving. Top with fresh thyme, extra Parmesan, and crispy fried onions if you want extra crunch.