Start by preparing your béchamel sauce.In a saucepan, melt the butter over low heat with a pinch of grated nutmeg, the garlic (peeled, degermed and pressed), then add the flour and mix with a whisk.Then gradually add the milk while continuing to mix without stopping with the whisk.When your béchamel has set and thickened, add the grated pecorino or parmesan cheese, season with pepper and mix again.Set aside. Preheat your oven to 180°C.
On a baking sheet covered with parchment paper, roll out one of the puff pastries.Pour a third of the béchamel sauce and spread it over the surface of the pastry, making sure to leave an empty border of about 2 cm.Place 2 slices of ham on top of the béchamel sauce, making sure to leave a 2 cm border.Pour another third of the béchamel and spread it out. Add half of the grated Comté cheese on top.Place the last 2 slices of ham, then the béchamel and the rest of the Comté cheese.Cover with the second puff pastry and weld the edges of the 2 pastries with your fingers. If you wish, you can brush the top with the egg yolk and milk/cream mixture, using a kitchen brush.
Bake in the bottom of your oven for 20-30 minutes (depending on your oven) and monitor for doneness.
Serve immediately with a nice green salad.