Heat oven to 400°F. Roast sweet potatoes until tender, about 1 hour 15 minutes. Set aside. Turn oven down to 300°F. Once cool enough to handle, peel and cut into 1-inch cubes.
Melt butter in a 6-quart saucepan over medium-high. Add cayenne, sage, garlic, and onion; cook until onions are translucent, 8–10 minutes. Add sweet potatoes and cream; simmer 5 minutes. Remove from heat and blend until smooth.
In a bowl, whisk egg yolks, then slowly whisk in the sweet potato mixture. Season with salt and pepper.
Pour into a 9×13-inch baking pan. Set inside a roasting pan on an oven rack. Pour boiling water into the outer pan to come halfway up the sides of the sweet potato dish.
Bake until firm, about 1 hour 30 minutes. Serve warm.