How to Make It
In a large pot, bring the milk and cream to a boil with the garlic. Season with salt and pepper. Add the celery root and sweet potatoes and cook, stirring occasionally, until slightly softened, about 2 minutes. Remove from the heat and let cool for about 20 minutes. Drain the sweet potato and celery root in a colander set over a large bowl and reserve the cooking liquid.
Meanwhile, in a medium skillet, cook the bacon over moderately high heat until crisp, about 4 minutes. Drain and transfer the bacon to a medium bowl. Squeeze out as much of the liquid as possible from the grated onion and apples, then add them to the bacon. Add the thyme and stir to combine.
Preheat the oven to 350°. Butter a 2 1/2-to 3-quart shallow baking dish. Arrange one-third of the celery root and sweet potatoes in an even layer. Spread half of the onion-bacon-apple mixture on top and season lightly with salt and pepper. Sprinkle with one-third of the cheese. Repeat the layering once more then top with the remaining celery root and sweet potatoes and the remaining cheese. Pour enough cooking liquid over the gratin to reach the top of the dish. Sprinkle with the panko and a buttered sheet of foil.
Bake the gratin in the center of the oven for 45 minutes. Remove the foil and bake for about 45 minutes longer, until bubbling and golden. Let the gratin rest for at least 30 minutes before serving.
The baked gratin can be refrigerated overnight. Return to room temperature before rewarming in the oven.