Preheat oven to 350 degrees F. Aggressively rub the inside of a 2 1/2- to 3-quart gratin dish or 3-quart rectangular baking dish with garlic clove. Generously butter the dish; set aside.
Using the mandoline or a knife slice the onion halves very thinly, approximately 1/16-inch thick (1/8-inch with a knife). Warm the olive oil in a large skillet. Cook onions gently, until tender and translucent, seasoning well with salt and pepper and stirring in thyme leaves at the end.
In a medium saucepan heat milk and cream just until simmering In a large saucepan melt 3 tablespoons butter over medium heat. Whisk in the flour. Remove from heat and gradually whisk in hot milk and cream. Return to heat and bring to boiling, whisking or stirring constantly. Boil gently for 3 to 5 minutes or until thickened and the consistency of buttermilk.
Peel russet and sweet potatoes. Very thinly slice potatoes on a mandoline to approximately 1/16-inch thick or slice thinly with a sharp knife. Layer one-third the potatoes in baking dish. Season generously with salt and pepper; sprinkle lightly with nutmeg. Top with one-third the onions and some of the sauce. Repeat layering in thirds, finishing with sauce (cream may not totally cover top).
Bake uncovered for 45 minutes. Increase oven temperature to 425 degrees F. Bake for 10 to 15 minutes more or until bubbly, golden crusty brown, and potatoes are tender when pierced with a wooden pick. Remove from oven. Let stand 10 minutes before serving.