Preheat your oven to 375°F (190°C). Lightly grease an 8x8-inch or similar-sized baking dish with cooking spray or olive oil.
Thoroughly wash the broccoli heads. Using a sharp knife, carefully cut the florets away from the main stem. Do not discard the stem! Peel the tough outer skin from the stem with a vegetable peeler or knife. Now, dice both the florets and the peeled stem into small, bite-sized pieces. You should have about 6 cups of diced broccoli.
In a large skillet, heat the 1 tablespoon of olive oil over medium heat. Add the finely diced onion and cook for 4-5 minutes, until it becomes soft and translucent. Add the minced garlic and cook for one more minute until fragrant. Remove the skillet from the heat.
In a large mixing bowl, combine the diced raw broccoli, the sautéed onion and garlic, the lightly beaten eggs, 3/4 cup of the Italian-style breadcrumbs, 3/4 cup of the grated Parmesan cheese, salt, black pepper, and optional red pepper flakes. Mix everything together until the broccoli is evenly coated and the mixture is well combined. It will be somewhat dry and crumbly, which is correct for this style of casserole.
Transfer the broccoli mixture to your prepared baking dish. Press it down gently into an even layer. Sprinkle the remaining 1/4 cup of breadcrumbs and 1/4 cup of Parmesan cheese evenly over the entire casserole.
Bake in the preheated oven for 35-40 minutes, or until the topping is deep golden brown and the broccoli is tender-crisp.
Remove the casserole from the oven and let it rest for 5 minutes before serving.