Preheat your oven to 350 F.
Melt 2 tablespoons of butter in a frying pan. Toss in the diced onion sand increase the heat to medium-high. Fry while stirring constantly until the onion turn golden brown, which should take approximately 10 minutes. Take the pan off the heat and leave the onions to cool down.
Incorporate the grated zucchini (ensure to eliminate any excess liquid),fried onions, eggs, flour, black pepper, and salt into a spacious bowl.
Blend all the components with a wooden spoon, being cautious not to overdo it.
Prepare a baking dish, grease it with butter, and transfer the mixture into it.
The casserole should be baked without a cover for approximately 45 minutes until it turns golden brown, and the center is firm.
Take it out of the oven and let it cool for a brief moment. Enjoy it while it's still warm, either as a side dish or paired with a refreshing salad.