Preheat oven to 325ºF.
Heat ghee (for Paleo or Whole 30) or coconut oil in a large cast-iron skillet over medium heat, then add sweet potatoes. Cook, stirring until beginning to soften, about 5-10 minutes.
Stir in the apples and cook until the apples begin to soften, about 5 minutes. Add the cinnamon, and raisins, and cook raisins are plumped, about 5-10 minutes more. Both apples and sweet potatoes should be easily pierced with a fork. If necessary; add a little water to prevent sticking and burning. Add pecans unless you’ll be sprinkling them on top, and salt. Stir to combine well and sauté the mixture a minute or two for the flavors to meld.
In a medium bowl, whisk eggs and coconut milk until smooth and well combined. (see note) Remove apple-sweet potato mixture from heat and pour egg mixture over.
Smooth the top of the casserole with the back of a spoon. If you reserved the pecans, sprinkle them on top now.
Bake for 20-30 minutes (it may need 35 minutes at high altitude or if your kitchen is cold, in which case it will take a bit longer for the oven's heat to get to the middle of the bake) or until set. A knife stuck in the middle should come out clean.
Allow to cool for at least 10 minutes before slicing to allow the eggs to set.