Preheat your oven to 400°F (200°C).
In a small saucepan over medium heat, melt 2 tablespoons of butter. Add the flour and whisk for about 1 minute until it forms a paste.
Gradually whisk in the milk, continuing to stir until the mixture thickens and bubbles, about 5 minutes. Stir in nutmeg, salt, and pepper. Remove from heat.
Spread Dijon mustard on one side of each slice of bread (if using). On four slices, layer the ham and then sprinkle the grated Gruyère cheese on top.
Top with the remaining slices of bread, mustard side down, to form sandwiches.
In a skillet, melt the remaining 2 tablespoons of butter over medium heat. Grill each sandwich for about 2-3 minutes on each side until golden brown.
Place the sandwiches on a baking sheet and pour the béchamel sauce over the top. Sprinkle with any remaining Gruyère cheese.
Bake in the preheated oven for 5-7 minutes, until the cheese is bubbly and golden.