Preheat the oven to 375°F (190°C).
Grease the baking dish with butter.
Thinly slice the russet potatoes using a sharp knife or a box grater, aiming for about ⅛ inch thick slices. Place the slices in a large mixing bowl.
In another bowl, whisk together the heavy cream, minced garlic, salt, pepper, and thyme, if using.
Layer half of the potato slices in the greased baking dish, overlapping them slightly. Pour half of the cream mixture over the potatoes, then sprinkle half of the cheddar and Gruyère cheese on top.
Repeat with the remaining potato slices, pouring the rest of the cream mixture over them and topping with the remaining cheeses.
Cover the baking dish tightly with aluminum foil and bake in the preheated oven for 45 minutes.
After 45 minutes, remove the foil and sprinkle Parmesan cheese on top of the scalloped potatoes. Return to the oven and bake uncovered for an additional 15 minutes, or until the top is golden and bubbly.
Allow the dish to cool for a few minutes before serving.