Preheat oven to 375 degrees F. Melt butter in a medium size saucepan over medium low heat. Add onions and garlic, stirring to coat with butter. Add 1/4 teaspoon kosher salt, and cook for 4 to 5 minutes until softened.
Add cream cheese and stir to help the cream cheese start to melt, for about two minutes. Then whisk in milk, cornstarch, honey, remaining 1 teaspoon salt, pepper, red pepper flakes. Turn heat up to medium, stirring to combine and continue melting the cream cheese, whisking until smooth. Bring ingredients to a soft simmer (not a boil) for about 2 to 3 minutes, until sauce is smooth and a bit thickened.
Add frozen corn to sauce and remove from heat. Stir to coat corn. Then stir in egg. Put mixture into a greased 7x10 inch baking pan (or baking pan of similar size). Top with buttered cornflakes.
Bake for 25 minutes, then broil for 2 to 3 minutes to crisp up the cornflakes. Let sit 5 to 10 minutes before eating (so it can set a bit). Top with flaky salt and minced green onion tops.
*You can make the corn mixture a full day ahead, remove from fridge and top with the cornflakes right before baking.