Ordinary ingredients become extraordinary when you combine potato with cheese, cream, and garlic.
Preheat oven to 375° and butter a large baking dish. Slice potatoes 1/4" thick and place in water to keep from browning.
In a large skillet over medium heat, melt butter. Add garlic and cook until fragrant, about 1 minute. Add cream, milk, thyme, nutmeg, salt, and red pepper flakes. Bring to a boil and reduce heat to low. Let simmer 10 minutes. Remove from heat.
Layer a third of potatoes, slightly overlapping, in a prepared dish then pour a third of the cream mixture over potatoes. Repeat with remaining potatoes and cream to make two more layers. Sprinkle Gruyère over top.
Cover with foil and bake for 45 minutes. Uncover, sprinkle with Parmesan and continue baking until potatoes are tender and a top is golden 15 to 20 minutes.