Preheat the oven to 350°F.
In a medium sauté pan over medium heat, melt the butter.
Cook the onion and garlic until the onion is slightly translucent, about 5 minutes.
In a large bowl, mix together the eggs, olive oil, coconut milk, and 2½ tablespoons of almond flour.
Season the mixture with salt and pepper.
Add the squash to the mixture in batches (like you’re battering it). Butter an 8-by-12-inch baking dish, and layer the squash into it.
Add some of the cooked onions and garlic, and repeat.
Once you’ve finished battering the squash and it’s all in the baking dish, pour the remaining egg mixture over the top of the squash.
Season again with a little more salt and pepper, then sprinkle the remaining 2½ tablespoons of almond flour on top and bake for 45 minutes, until lightly browned.
Serve hot, garnished with the scallions.