Preheat the oven to 350 degrees F.
In a large bowl, whisk together the eggs, milk, half and half, thyme, salt and pepper.
Add the bread to the egg mixture along with the grated cheese and diced ham.
Using your hands or a spatula, mix the ingredients well making sure the bread has been well soaked in egg.
Transfer the whole mixture from the bowl to a 2-quart oven-safe dish and spread out evenly.
Cover with foil and bake in the oven for 30 minutes.
While the casserole is baking, make the béchamel sauce by melting the butter in a non stick pan.
Add the flour and whisk together for 2-3 minutes.
Gradually add 1 1/4 cups of the milk, whisking constantly over medium heat to get rid of any lumps. Save a quarter cup of the milk for later. The sauce will thicken as it cools and that’s okay.
Add the nutmeg when the sauce is smooth. Remove the sauce from the heat and set aside until the casserole is done.
Once the casserole is done, take the foil off. Turn the oven up to 425 degrees F.
Bring the béchamel sauce back to the burner and place on low heat. Whisk the remaining quarter cup of milk into it until it’s smooth again.
Pour the béchamel sauce over the casserole and then top with the remaining 1 1/2 cups grated Gruyere.
Place back into the oven and bake for a further 8 minutes uncovered.
Take the casserole from the oven and carefully create two slightly sunken holes with the back of a spoon.
Crack an egg into both holes and place back into the oven or under the broiler until the egg whites are firm.
Sprinkle with extra fresh thyme and serve alongside a hot cup of coffee.