Preheat an oven, then coat a 9×13 baking dish with nonstick spray or butter. In a large bowl, mix together flour, cornmeal, sugar, baking powder, Kosher salt, and a pinch of cayenne pepper.
In a separate large bowl, whisk together heavy cream, melted butter , large eggs, and sour cream.
Heat a skillet over medium-high heat, then add neutral oil. When hot, add chopped onion and cook, stirring occasionally, until softened. Stir in chopped thyme, then remove from the heat.
To the wet ingredients, add canned corn, sautéed onion, grated Gruyere, and flour mixture. Stir until well mixed, then pour into the prepared baking dish.
Transfer to a preheated oven and bake until the top is golden brown. Sprinkle with a generous pinch of flaky sea salt, then garnish with additional fresh thyme leaves. The corn pudding will settle a bit as it cools. Enjoy warm!