Preheat your oven to 425°F (220°C) and line a baking sheet with parchment paper.
In a large mixing bowl, combine the cubed sweet potatoes, maple syrup, olive oil, ground cinnamon, nutmeg, salt, and pepper. Toss until the sweet potatoes are evenly coated.
Spread the sweet potatoes in a single layer on the prepared baking sheet, making sure they have some space between them for even roasting.
Roast in the preheated oven for 25-30 minutes, stirring halfway through, until the sweet potatoes are tender and caramelized around the edges.
In the final 5 minutes of roasting, sprinkle the chopped pecans over the sweet potatoes and return to the oven. This will toast the pecans and enhance their flavor.
Once the sweet potatoes are done, remove them from the oven and let them cool for a few minutes.
Transfer to a serving bowl and garnish with fresh thyme leaves if desired.