01 -
Position a rack in the center of the oven and preheat to 190°C. Butter a 2-quart shallow oval baking dish or medium ovenproof skillet and set aside.
02 -
In a small saucepan over medium-low heat, combine shallots, garlic, cream, and thyme. Bring to a gentle simmer, stirring occasionally, and cook until shallots and garlic become very tender, approximately 15 minutes. Remove from heat, discard thyme, and allow to cool slightly.
03 -
Transfer the cream mixture to a blender or use an immersion blender to process until smooth and homogenous.
04 -
Spread one-third of the cream sauce evenly over the bottom of the prepared baking dish. Arrange half of the sliced potatoes atop the sauce and season lightly with kosher salt and black pepper. Layer half of the sliced ham over the potatoes, followed by another one-third of the cream sauce. Repeat the layering process with the remaining potatoes, ham, and cream sauce.
05 -
Seal the dish tightly with foil and bake in the preheated oven until the sauce is bubbly and potatoes are tender, roughly 60 minutes.
06 -
Remove the foil and evenly sprinkle the grated Gruyère and Parmesan cheeses over the casserole.
07 -
Set the oven broiler on high and broil the dish for about 4 minutes, watching closely until the cheese is golden and bubbling without burning.
08 -
Top with freshly chopped parsley before serving.