Preheat your oven to 400℉. In your prepping area, place two squares of foil on top of each other, shiny side up.
Cut off the top of the head of garlic so that the tops of the cloves are exposed. Remove any large pieces of papery peel, but don’t peel it entirely. Drizzle the head with a little bit of olive oil and rub it all around the head. Wrap the head with foil, folding the sides to seal like a packet, and place it into the oven. Roast until the garlic is tender, which should take about 45 minutes.
Once the garlic is roasted, squeeze each clove out of its skin and finely chop it. Reduce the oven temperature to 350℉.
In a very large, oven-safe frying pan, heat 2 tablespoons of olive oil over medium-high heat. Cook the onion until golden brown and soft, which should take about 5 minutes.
Add 1 cup of coconut milk and 1 cup of almond milk to the frying pan and bring to a boil. While waiting for the liquid to boil, whisk together the remaining 1 tablespoon of coconut milk, 1 tablespoon of almond milk, and 1½ tablespoons of tapioca starch in a small bowl until smooth.
Once the milk mixture boils, whisk in the tapioca starch mixture, stirring constantly so it doesn’t clump. Boil for 2 minutes while stirring continuously.
Reduce the heat to medium, then add the dairy-free cream cheese, sea salt, thyme, nutmeg, black pepper, and chopped roasted garlic. Cook the sauce for an additional 5-6 minutes, until it thickens and the cream cheese has melted, stirring frequently.
To assemble, add the thinly sliced sweet potatoes to the pan. Stir them around in the mixture to coat. Arrange the potatoes with a spoon until they form flat layers.
Layer half the potatoes in a lightly-greased casserole dish, pour half of the thickened sauce over them, and then repeat until all potatoes and sauce are finished.
Cover with foil and bake for 30 minutes. After that, uncover the pan, press the potatoes down to completely submerge them in the sauce, and sprinkle the pecans over the top. Cook for an additional 30 to 40 minutes, until the potatoes are fork-tender and the top is browned.
If you want a crispy top layer, turn your oven to high broil and broil the potatoes for the last 3 to 4 minutes of cooking to darken the top.
Let the potatoes stand for 10 minutes at room temperature. Sprinkle with more thyme to garnish, then serve.