Prepare the Oven: Preheat the oven to 300°F and position a rack near the top.
Caramelize the Onions: In a heavy oven-safe skillet, melt the butter over medium heat. Add the sliced onions and cook until golden at the edges, about 5 minutes. Lower the heat, add the bay leaf and a pinch of salt, and continue cooking, stirring occasionally, until deeply caramelized, about 15 minutes. Stir in the red wine and reduce by half, approximately 3 minutes. Adjust salt if needed. Remove the bay leaf.
Prepare the Egg Mixture: In a bowl, whisk together the eggs, grated Gruyère cheese, olive oil, ½ teaspoon salt, and black pepper.
Combine and Set: Add the egg mixture to the skillet with the onions, stirring gently to combine. Cook on the stovetop until the bottom begins to set, about 2 minutes.
Bake the Frittata: Transfer the skillet to the oven and bake until the frittata is set around the edges but slightly custardy in the center, about 12-15 minutes for a 9-inch skillet or 15-20 minutes for an 8-inch skillet. Monitor closely to avoid overcooking.
Garnish and Serve: Slide the frittata onto a serving plate, sprinkle with chopped parsley and flaky sea salt, and serve.