Preheat your oven to 375°F (190°C).
Grease the 9x13 inch baking dish with a little butter or cooking spray to prevent sticking.
In a large mixing bowl, combine the heavy cream, whole milk, minced garlic, flour, salt, and ground black pepper. Whisk until well combined.
Layer half of the sliced potatoes evenly in the bottom of the prepared baking dish. Pour half of the creamy mixture over the potatoes, ensuring they are well coated.
Sprinkle half of the cheddar cheese over the layers, followed by half of the Parmesan cheese.
Repeat the layers with the remaining potato slices, creamy mixture, and top with the remaining cheddar and Parmesan cheese.
Cover the baking dish with aluminum foil and bake in the preheated oven for 45 minutes.
After 45 minutes, remove the foil and bake for an additional 15 minutes, or until the top is golden and bubbly.
Once finished, remove from the oven and allow to cool for a few minutes before serving. Garnish with fresh thyme leaves if desired.