Line a baking sheet with parchment paper. In a small bowl, whisk together crème fraîche, Greek yogurt, ground nutmeg, and salt. Set aside.
Preheat the oven to 400°F. Cook the bacon in a small skillet over medium heat until the fat has rendered and the bacon is cooked but not crisp. Transfer to a plate and set aside to cool.
On a well floured surface, roll out the puff pastry into a square or rectangle. Transfer the pastry to the prepared baking sheet.
Using a knife, score a ¾-inch border around the pastry without cutting all the way through. Spread the crème fraîche mixture evenly inside the border.
Scatter the cooked bacon pieces over the creamy mixture, followed by the sliced onions and grated Gruyère cheese.
Beat the egg and brush it over the pastry border. Bake for 18–20 minutes, or until the pastry edges are golden brown and puffed. Sprinkle freshly ground black pepper over the tart and serve immediately.