Preheat oven to 375°F and grease a 9x13-inch glass casserole dish.
Melt butter in a large skillet over medium heat, add onions and ½ tsp salt, cook for 25 minutes until golden, adding olive oil and sugar if needed.
Whisk heavy cream, 1 cup Parmesan, remaining salt, black pepper, and thyme in a bowl, then stir in caramelized onions.
Slice potatoes into ⅛-inch rounds evenly.
Spread potatoes evenly in the prepared dish.
Pour the creamy onion mixture evenly over the potatoes and gently distribute.
Sprinkle remaining Parmesan on top and cover tightly with foil.
Bake for 50 minutes on the middle rack until tender.
Remove foil and bake 15 minutes until golden and bubbly.
Rest for 10 minutes before serving.
