Preheat the oven to 350°F (175°C) and butter a 9-by-13-inch baking dish.
Arrange the sliced potatoes in a bowl of cold water while you prepare the sauce, then drain and pat them dry.
Melt the butter in a saucepan over medium heat, add the onion, and cook for 5 to 6 minutes until softened; stir in the garlic for 30 seconds.
Whisk in the flour and cook for 1 minute, then gradually whisk in the milk and cream until smooth.
Bring the sauce to a gentle simmer and cook for 3 to 5 minutes, whisking often, until it lightly coats a spoon; stir in the thyme, salt, pepper, and nutmeg.
Layer half of the potatoes in the baking dish, pour over half of the sauce, and repeat with the remaining potatoes and sauce.
Cover the dish tightly with foil and bake for 55 to 65 minutes, until a knife slides easily into the center potatoes.
Remove the foil and bake for 20 to 25 minutes, until the top is golden and the sauce is bubbling at the edges.
Rest the potatoes for 15 minutes before serving so the sauce can settle.