Preheat your oven to 180°C (350°F) and butter your baking dish well to prevent sticking.
Use a mandoline slicer to cut the potatoes into thin, even slices about 2mm thick—this helps them cook uniformly and look beautiful.
In a large skillet, melt the butter over medium heat and add the sliced shallots. Cook gently, stirring occasionally, until they turn golden and fragrant, about 10 minutes.
In a mixing bowl, whisk together the heavy cream, grated Gruyère, Dijon mustard, a pinch of nutmeg, and a little salt and pepper to taste. Mix until smooth and creamy.
Layer a few slices of potato in the prepared baking dish, overlapping slightly to create a uniform layer. Spoon some caramelized shallots over the potatoes, spreading evenly.
Repeat layering potatoes and shallots until all ingredients are used, finishing with a layer of potatoes on top.
Pour the cheese and cream mixture evenly over the layered potatoes, ensuring all slices are coated and the sauce seeps through the layers.
Cover the dish tightly with aluminum foil and bake in the preheated oven for about 45 minutes, until the potatoes are tender and bubbling.
Remove the foil and continue baking for another 15 minutes, or until the top is golden brown and bubbly.
Take the dish out of the oven and let it rest for 10 minutes—this helps the sauce set and makes serving easier.
Slice and serve the cheesy scalloped potatoes hot, with the layers of tender potatoes, caramelized shallots, and cheesy sauce creating a luscious final presentation.