Melt the butter in a small saucepan over medium heat. Whisk in the flour and cook for about one minute, just until lightly golden.
Slowly whisk in the warm milk until smooth. Add Dijon, nutmeg, salt, and pepper. Cook for 2 to 3 minutes, stirring, until thickened. Remove from heat.
Preheat oven to 425°F.
Butter one side of each slice of bread. Flip over and spread Dijon on the unbuttered side if using.
Spread a spoonful of béchamel on four slices, top with ham and Gruyère, then place remaining bread slices on top, buttered side out.
Toast sandwiches in a skillet over medium heat, about 2 to 3 minutes per side, until lightly golden.
Transfer to a baking sheet. Spoon more béchamel on top and sprinkle with remaining Gruyère and Parmesan. Bake for 10 to 12 minutes, until bubbly and golden.