In a pot of boiling salted water, blanch the green beans for about 3-4 minutes until bright green and tender-crisp. Quickly transfer them to an ice bath to stop the cooking process. Drain and set aside.
In a large skillet over medium heat, add a splash of oil. Once hot, add the pearl onions and cook until they become translucent (about 5 minutes). Add the mushrooms and garlic, cooking for another 3-4 minutes until the mushrooms are softened.
In the skillet, stir in the crème fraîche, vegetable broth, soy sauce, Dijon mustard, Worcestershire sauce, and fresh thyme. Season with salt and pepper, and bring the mixture to a gentle simmer for about 3 minutes, allowing the flavors to meld.
Add the blanched green beans to the skillet and mix well until they're coated in the sauce. Remove from heat.
Roll out the puff pastry on a floured surface and cut it into squares large enough to fit into a muffin tin. Place each square into the muffin cups, gently pressing them down to form little pastry cups.
Spoon the green bean mixture into each pastry cup, filling them generously.
Sprinkle a layer of fried onions over each filled cup for crunch.
Brush the edges of the puff pastry with the beaten egg for a golden finish. Place the muffin tin in the preheated oven and bake for 20-25 minutes or until the pastry is golden brown and the filling is bubbly.
Once baked, allow the casserole cups to cool for a few minutes. Carefully remove them from the muffin tin and serve warm.