Preheat oven to 400 degrees. Grease a 9x9 baking dish or similar size baking dish with non-stick cooking spray.
Heat a small saute pan over a medium heat. Add butter. Once the butter melts, add onion and garlic and turn the heat to medium-low. Sweat the onion and garlic until slightly softened, about 4-5 minutes. Season with a little salt and pepper. Remove from heat and let cool slightly.
Add flour, cornmeal, cornstarch, and sugar to a large bowl. Whisk to combine. Add heavy cream, eggs, creamed corn, butter, onion, and garlic. Whisk just until combined. Fold in frozen corn.
Pour into prepare baking dish and pop in the oven. Bake until golden brown on top, about 30 minutes. The center should be set, but slightly jiggly. Let the corn pudding rest for 3-4 minutes before serving.