Preheat the oven to 350 degrees. Grease an 8-inch square baking dish with unsalted butter.
Peel the potatoes. Using a mandolin or sharp knife, cut the potatoes into 1/8-inch-thick slices.
To a medium saucepan, add sliced potatoes, heavy cream, whole milk, 2 tablespoons butter, garlic, thyme, 1 1/2 teaspoons salt, 1/2 tsp. pepper, and nutmeg. Bring to a simmer over medium heat and cook, stirring occasionally, until the potatoes are tender and almost cooked through, but still hold their shape, about 5 minutes.
Add the gruyere and Parmesan cheese, stirring gently to combine. Pour the potato mixture into the prepared baking dish. Bake until the top is light golden brown, and the potatoes are cooked through and tender, about 45 minutes. Let rest for 10 minutes before serving.