Preheat oven to 350°F (175°C). Butter a 9x13 ceramic baking dish generously.
Peel and thinly slice the potatoes using a mandoline (1/8-inch thick).
Grate the cheeses. Mix cheddar and Gruyère together in one bowl, reserve Parmesan separately.
In a heavy-bottomed saucepan, melt butter over medium heat until foamy.
Add onion and cook until translucent, about 5 minutes. Add garlic and sauté for 30 seconds.
Whisk in flour and cook for 1–2 minutes until a golden roux forms.
Gradually whisk in the warm cream, milk, and broth until smooth.
Stir in salt, pepper, thyme, and nutmeg. Simmer until thickened, about 3–4 minutes.
Remove from heat and stir in 1/2 cup of the cheddar-Gruyère mixture to melt into the sauce.
Spread a thin layer of sauce on the bottom of the baking dish.
Layer one-third of the potato slices, followed by one-third of the sauce and cheese mixture. Repeat twice more.
Top with remaining cheese mixture and the reserved Parmesan.
Cover with foil and bake for 45 minutes.
Remove foil and bake uncovered for an additional 25–30 minutes until golden and bubbling.
Let rest for 15 minutes before serving to allow the sauce to set.