Preheat and prepare: Preheat the oven to 375°F (190°C). Generously butter a 9×13-inch baking dish.
Slice the potatoes: Using a mandoline or sharp knife, slice the potatoes evenly, about ⅛ inch (3 mm) thick. Do not rinse the sliced potatoes.
Prepare the cream mixture: Combine the heavy cream, whole milk, garlic, and nutmeg in a medium saucepan. Warm over medium heat until hot but not boiling. Remove from the heat and stir in half of the thyme.
Start layering: Arrange one-third of the potato slices in the bottom of the prepared baking dish, slightly overlapping them. Season lightly with salt and black pepper.
Add the cheese and cream: Sprinkle one-third of the Gruyère and Parmesan over the potatoes, then pour one-third of the warm cream mixture evenly over the layer.
Repeat the layers: Repeat the potatoes, seasoning, cheese, and cream twice more, finishing with the remaining cream and a generous layer of cheese on top.
Bake covered: Cover the baking dish tightly with aluminum foil and bake for 40 minutes.
Brown the top: Remove the foil and continue baking for 20–30 minutes, until the top is bubbling and deeply golden and a thin knife slides easily through the potatoes in the center of the dish.
Rest and serve: Sprinkle with the remaining fresh thyme and let the gratin rest for 10 minutes before serving.