01 -
Preheat the oven to 375°F and grease a 9×13-inch baking dish with butter.
02 -
In a saucepan over low heat, warm the heavy cream, butter, minced garlic, thyme, salt, and black pepper until the butter melts.
03 -
Peel and slice the potatoes and onion to 1/8-inch thickness using a mandolin for uniformity.
04 -
Arrange one-third of the sliced potatoes and onions in the prepared dish. Pour over one-third of the cream mixture and top with one-third of the Gruyère cheese.
05 -
Repeat the layering process twice more, reserving the final portion of cheese for later. Cover the dish tightly with foil.
06 -
Bake in the preheated oven for 75 to 90 minutes until the potatoes in the center are fork-tender.
07 -
Remove the foil and sprinkle the remaining Gruyère and Parmesan cheeses over the top layer.
08 -
Return the dish to the oven, uncovered, and bake for an additional 15 minutes until golden and bubbly.
09 -
Let the dish rest for 10 to 15 minutes before serving to allow the sauce to set.