Preheat the oven to 200°C/180°C fan/gas 6.
Start by making the béchamel. Put the milk and thyme into a small saucepan. Gently bring to a simmer over low heat. Melt the butter in another small saucepan then add the flour, and a pinch each of salt and pepper. Cook over low heat for about 1 minute to get rid of the floury taste, but avoid letting it brown.
Gradually whisk in half of the hot milk and stir quickly to combine. Add the remaining milk and cook for a further five minutes over low heat, stirring continuously.
Remove from the heat, add the mustards and cheese and stir until the cheese has melted.
Place the grated Gruyère on one slice of the sourdough then top with the prosciutto. Finish with the béchamel then top with the other slice of sourdough. Heat a frying pan over medium heat. When hot, add the butter then carefully add the sandwich and toast it for 3-5 minutes. Gently turn the sandwich over and brown the other side for another 3-5 minutes.
Transfer to a piece of baking parchment on a baking tray and bake in the oven for 4-5 minutes, until the cheese has melted.