Preheat the oven to 375°F (190°C). Lightly butter a shallow baking dish or a cast-iron skillet.
In a small bowl, whisk together the melted butter, minced garlic, and cream. Stir in the Parmesan, salt, pepper, and thyme. If you're using nutmeg, add a pinch.
Layer half of the sliced sweet potatoes in the dish in an overlapping pattern. Pour half of the creamy sauce over them. Sprinkle half of the mozzarella if using.
Add the remaining sweet potatoes in a second layer. Pour the rest of the sauce over the top and sprinkle with the remaining cheese.
Cover the dish with foil and bake for 25 minutes. Remove the foil and bake for another 15–20 minutes, until the potatoes are tender and the top is bubbly and lightly golden.
If you like a crisper top, turn on the broiler for 1–2 minutes at the end, keeping a close eye to prevent burning.
Let it rest for about 5 minutes before slicing. Garnish with chopped parsley and a final crack of black pepper.