Slice the potatoes into 1/16” thick rounds using a mandolin or knife. Place the potatoes in a large bowl.
In a large pot, heat unsalted butter over medium heat until melted. Add the garlic, chopped rosemary and thyme and saute for 30 seconds, then add the flour and whisk until combined and there are no lumps. Cook for 1 minute, then add the cold milk and whisk to remove any lumps, then add the heavy cream and whisk together. Season with salt and pepper.
Heat over medium heat until bubbling and slightly thickened, about 3-4 minutes. Grate in the nutmeg, then mix and turn off the heat. Fold in 6 oz of the cheddar cheese and 6 oz of the gruyere cheese until melted and let cool slightly. Pour the mixture over the potatoes and toss until fully coated.
Grease the baking dish with butter, then lay down the potatoes in flat, stacked layers until all the potatoes are layered.
Bake uncovered at 400°F for 45 minutes. Remove from the oven and top the potatoes with the reserved cheese. Return to the oven and bake for another 15 mintues or until the cheese is golden brown.
Let sit for 15 minutes to allow the potatoes to set and cool.
Notes
I like using a mandolin because it ensures that the slices are even, which will help the dish cook evenly. HOWEVER - please use the guard that came with the mandolin or a cut resistant glove. Mandolins are very dangerous if used improperly. It's better to have uneven slices than to hurt yourself while making this dish!
I recommend using a wide shallow baking dish - this allows for more surface area, which will help the top layer of cheese turn crispy when broiled. This layer of cheese provides a nice textural contrast to the creaminess of the dish.
The final step of letting the potatoes rest for 15 minutes is KEY to the success of this dish - once you've taken the potatoes out of the oven and set on a heatproof surface, leave them alone for 15 minutes! This will allow the potatoes to cool, thicken, and meld together. This makes a huge difference in the taste and texture of the final dish. If you do not let the potatoes rest before serving, they'll likely be too runny and too hot to enjoy. Do not skip resting!