Heat the oven to 400°F/200°C.
Melt the butter in a large ovenproof skillet over medium heat. Add the onion and cook, stirring occasionally, until softened, 5 to 7 minutes.
Add the sweet potatoes, carrots, and squash. Cook, stirring occasionally, until slightly softened, 3 to 4 minutes.
Add the olive oil, thyme, garlic powder, cinnamon, turmeric, pepper, and salt. Sprinkle in the flour and stir until the vegetables are evenly coated.
Gradually whisk in the broth and milk. Bring to a gentle simmer, cover, and cook until the vegetables are tender and the sauce has thickened, 12 to 15 minutes.
Stir in the beans and kale. Taste and adjust the seasoning. Remove from the heat.
Lightly roll the puff pastry on a floured surface until large enough to cover the skillet. Drape it over the filling, pressing the edges gently against the rim. Set the rosemary sprigs on top.
Brush the pastry with the beaten egg. Cut several small vents in the top.
Bake until the pastry is puffed and deeply golden and the filling is bubbling, 25 to 30 minutes. Let stand for 10 minutes before serving.
Refrigerate leftovers for up to 4 days. Reheat in a 350°F/175°C oven until hot throughout, 5 to 10 minutes.