Preheat oven to 400°F. Line a baking sheet with parchment.
Warm olive oil and butter in a large skillet over medium heat.
Sauté onion until translucent, about 3 to 4 minutes.
Add mushrooms. Cook until browned and moisture evaporates, 8 to 10 minutes.
Stir in garlic, thyme, salt, pepper, and red pepper flakes. Cook 1 minute.
Sprinkle in flour. Cook, stirring, for 1 minute to thicken.
Add lemon juice and parsley. Remove from heat and cool 10 minutes.
Unfold puff pastry on parchment. Roll into a 10x12-inch rectangle.
Spread Dijon down the center third of the pastry.
Scatter half the Gruyère over the mustard. Spoon mushroom filling on top.
Top with remaining Gruyère. Cut 1-inch strips along both sides.
Fold strips over the filling, alternating to form a braid. Tuck the ends.
Whisk egg with water. Brush the pastry all over with the egg wash.
Bake 25 to 30 minutes, until deeply golden and puffed.
Rest 10 minutes before slicing. Serve warm.