Preheat the oven to 375°F (190°C).
Grease a baking dish with butter.
In a large bowl, combine heavy cream, minced garlic, salt, pepper, and thyme.
Layer the bottom of the baking dish with a portion of the sliced potatoes.
Pour a portion of the cream mixture over the potatoes.
Sprinkle some Gruyère cheese over the cream.
Repeat layering with remaining potatoes, cream, and cheeses.
Finish with a layer of potatoes and top with Parmesan cheese.
Cover the dish with foil and bake for 40 minutes.
Remove the foil and bake for an additional 20 minutes until golden and bubbly.