Preheat the oven to 375°F (190°C). Grease a 9x13-inch baking dish.
Melt butter in a saucepan over medium heat. Add garlic and cook until fragrant, about 1 minute.
Whisk in flour and cook for another minute, then gradually add milk and heavy cream, whisking constantly.
Stir in cheddar cheese, Parmesan, salt, pepper, paprika, and thyme. Cook until the cheese is melted and the sauce is smooth.
Layer half of the sliced potatoes in the baking dish. Pour half of the cheese sauce over them.
Repeat with remaining potatoes and cheese sauce.
Cover with foil and bake for 40 minutes. Uncover and bake for an additional 20 minutes until golden and bubbly.
Let cool for 10 minutes before serving.