Preheat the oven to 350 degrees . In a medium saucepan, combine the cream, thyme, 1 1/2 tsp. salt, garlic and red pepper. Season with black pepper. Bring to a simmer, remove from the heat and let steep for 5 minutes. Discard the thyme sprigs.
Drizzle 2 tbsp. of the cream mixture in the bottom of a 9-by-13-inch baking dish. Cover the bottom of the pan with a single layer of sweet potato slices. Season with salt and pepper and drizzle with about 1/4 cup of the cream mixture. Continue layering with the remaining sweet potato slices, salt and pepper and cream. Top with the remaining cream, then sprinkle with the cheese. Cover with foil, tenting in the center to prevent the cheese from sticking. Bake until a knife inserted into the center goes in easily, about 1 hour 20 minutes.
Meanwhile, in a medium bowl, combine the panko, brown sugar, 2 tsp. coarse pepper, the lemon zest and 1 tsp. salt.
Uncover the gratin and sprinkle the top with the panko mixture; bake for 10 minutes. Broil the gratin until browned and crunchy, about 5 minutes longer. Let rest 15 minutes before serving. Top with scallions, if using.