Preheat the oven to 350 degrees, spray a 9 x 13-inch baking dish with cooking spray, and set aside.
Mix melted butter, onions, salt, black pepper, cream of celery soup, sour cream, and cream cheese in a large bowl. Mix until well combined.
Add hash browns and cheddar cheese to wet ingredients. Mix until well combined.
Add potato mixture to the prepared 9 x 13-inch baking dish and spread them out evenly.
Sprinkle 1½ cups of cheddar cheese over the top of the potatoes.
Mix crushed corn flakes and melted butter in a medium bowl, and sprinkle over the potatoes.
Bake for 35-40 minutes or until casserole is browned and bubbles around the edges.
Serve while hot and enjoy!