Preheat oven to 350°F. Coat a 9-by-13-inch baking dish with cooking spray.
Place sweet potatoes and water in a microwaveable bowl. Cover tightly and microwave on High until tender, about 3 minutes. Drain and let cool, about 10 minutes.
Meanwhile, heat oil in a large nonstick skillet over medium-high heat. Add apple, sausage and onion; cook, stirring often, until the sausage browns and the apple softens, about 6 minutes. Add garlic and thyme; cook, stirring constantly, until fragrant, about 1 minute. Remove from heat and let cool in the pan, about 10 minutes.
Combine the cooled sweet potatoes and the sausage mixture in a large bowl; add bread and Gruyère and toss gently. Whisk eggs, milk, mustard and pepper together in a medium bowl. Pour over the bread mixture and toss gently. Transfer to the prepared baking dish and cover with foil. Bake until the custard is mostly set, about 30 minutes. Remove the foil and continue to bake until the topping is golden brown and the custard is set, about 20 more minutes. Let stand for 10 minutes before slicing. Garnish with thyme leaves, if desired.