In a skillet, melt the butter over medium heat. Once melted, add the diced onion and minced garlic. Sauté until the onion becomes translucent and fragrant, about 5 minutes.
In a large mixing bowl, combine the cottage cheese, mayonnaise, and eggs. Whisk them together until smooth and well blended.
To the egg mixture, add the flour, salt, pepper, and hot sauce. Stir until all ingredients are fully incorporated.
Carefully fold in the thawed spinach and two cups of the shredded cheddar cheese into the mixture, along with the sautéed onion and garlic.
Pour the spinach and cheese mixture into a greased 9x13 inch baking dish. Spread it out evenly with a spatula.
Sprinkle the remaining one cup of shredded cheddar cheese over the top of the casserole.
Preheat your oven to 350°F (175°C) and bake the casserole for 35-40 minutes, or until it is set in the center and the cheese on top is golden and bubbly.