Preheat the oven to 375°F (190°C). Lightly grease a small baking dish or casserole dish that will fit the mixture.
Peel the sweet potatoes and cut them into rough 1-inch chunks. Boil in salted water until very tender, about 12–15 minutes.
While the potatoes cook, toss the diced apples with a teaspoon of lemon juice if you like a touch of brightness, and set aside.
Drain the potatoes well and mash them smooth. Stir in the melted butter, milk, and the beaten egg until you have a creamy mixture.
Mix in the cinnamon, vanilla, salt, and brown sugar. If the mixture seems dry, add a splash more milk. Fold in the apples gently.
Spread the mixture into the prepared dish. If you want a bit of a crusty top, sprinkle a teaspoon of brown sugar over the surface.
Bake for 25–30 minutes, until the edges are set and the top is lightly golden. If you prefer a crisper top, broil for 1–2 minutes at the end, watching closely.
Let the casserole rest for a few minutes before serving. A light drizzle of honey or a pinch of nutmeg on top can be lovely for serving.