Preheat oven to 400° F.
Roll Puff Pastry into 11 or 12-inch square on a floured surface. Transfer to 9-inch tart pan. Trim edges to within 1/2-inch, and fold edges into sides of crust. Place in freezer for 30 minutes. Place frozen tart shell on baking sheet. Dock with fork. Press crumpled piece of parchment paper down inside tart shell. Fill with dried beans or pie weights and bake until top edge just starts to color and surface of dough under parchment paper no longer looks wet, about 25 minutes. Remove from oven and carefully remove parchment paper and weights by gathering edges of parchment paper and pulling up and out. If cracks form in shell, brush with lightly beaten egg. Return baking sheet with tart shell to oven and bake until golden brown, 5 minutes. Set baking sheet with tart shell on wire rack. Cool completely.
Heat 2 tablespoons of butter in 12-inch skillet over medium heat. Add onions, thyme, salt, and pepper. Cover and cook until onions for 15 minutes, stirring once or twice. Remove lid and continue to cook another 10 minutes. Remove pan from heat and let onions cool 15 minutes.
Take mushrooms by the handful and squeeze to release liquid. Place in paper towels and squeeze again to remove as much liquid as possible.
Heat remaining tablespoon of butter in 10-inch skillet over high heat. Add mushrooms; cook, stirring constantly until liquid evaporates, about 1 minute. Add Madeira and continue cooking over high heat until liquid evaporates, about 1 to 2 additional minutes. Remove from heat; cool.
Whisk eggs and half-and-half together in large bowl. Stir onions and mushrooms into egg mixture. Spread onion mixture over baked crust (still on baking sheet).
Bake at 375°F until center of tart feels firm to touch, 20 to 25 minutes.
Cool on wire rack at least 10 minutes. When ready to serve, remove tart pan ring; gently slide thin-bladed spatula between tart pan bottom and crust to loosen, then slide tart to serving plate. Cut into wedges and serve.
Yield: One 9-inch tart.