Mix the dry ingredients. Preheat an oven to 350°F (175°C), then coat a 9x13 baking dish with nonstick spray or butter. In a large bowl, mix together ½ cup (60g) flour, ¼ cup (45g) cornmeal, 3 Tbsp (38g) sugar, 1 Tbsp baking powder, 1 tsp Kosher salt, and a pinch of cayenne pepper.
Mix the wet ingredients. In a separate large bowl, whisk together 1½ cups (355ml) heavy cream, 6 Tbsp melted butter (85g), 4 large eggs, and ½ cup (125g) sour cream.
Sauté the onion. Heat a skillet over medium-high heat, then add 1 Tbsp neutral oil. When hot, add chopped onion and cook, stirring occasionally, until softened, about 3-5 minutes. Stir in 2 Tbsp chopped thyme, then remove from the heat.
Add the corn. To the wet ingredients, add canned corn, sautéed onion, 1 cup grated Gruyere (or white Cheddar), and flour mixture. Stir until well mixed, then pour into the prepared baking dish.
Bake the corn pudding. Transfer to a preheated oven and bake for 45 minutes, or until the top is golden brown. Optional: Can broil on high for a few minutes to get a little color on the crust. 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!