Preheat your oven to 375°F (190°C).
In a large mixing bowl, combine the heavy cream, minced garlic, salt, pepper, nutmeg, and thyme. Whisk until well combined.
Grease the baking dish with a little butter or cooking spray to prevent sticking.
Arrange a layer of sweet potato slices at the bottom of the baking dish, slightly overlapping each slice.
Pour a portion of the cream mixture over the sweet potatoes, then sprinkle with a layer of the shredded cheddar and Gruyère cheeses.
Repeat layers of sweet potatoes, cream, and cheese until all ingredients are used, finishing with the remaining cream.
Sprinkle the grated Parmesan cheese on top for a crispy, flavorful crust.
Cover the dish with aluminum foil to prevent burning and bake in the preheated oven for 40 minutes.
After 40 minutes, remove the foil and bake for an additional 10 minutes, or until the top is golden brown and the sweet potatoes are tender.
Remove from the oven and let it sit for 10 minutes before serving.