Preheat the Oven: Preheat your oven to 375°F (190°C). Grease a 9x13-inch (23x33 cm) baking dish with butter.
Prepare the Potatoes: Peel and thinly slice the potatoes. You can use a mandoline or a sharp knife to ensure even slices.
Make the Cream Mixture: In a large bowl, combine the heavy cream, milk, minced garlic, salt, black pepper, and ground nutmeg. Mix well until combined.
Assemble the Gratin:
Arrange a layer of sliced potatoes in the greased baking dish, overlapping slightly.
Sprinkle about ¼ cup of grated Gruyère cheese evenly over the potatoes.
Pour about ¼ of the cream mixture over the potatoes, ensuring they are evenly coated.
Repeat the layers of potatoes, cheese, and cream mixture until all ingredients are used, finishing with a layer of potatoes on top.
Top the Gratin: Sprinkle the remaining Gruyère cheese and the grated Parmesan cheese evenly over the top layer of potatoes. Sprinkle the fresh thyme leaves over the cheese.
Bake the Gratin: Cover the baking dish with aluminum foil and bake for 45 minutes. Remove the foil and continue baking for an additional 30 minutes, or until the potatoes are tender and the top is golden brown and bubbly.
Rest and Serve: Remove the gratin from the oven and let it rest for 10 minutes before serving. This allows the flavors to settle and makes it easier to serve.