01 - Preheat oven to 190°C (375°F). Grease a 23x33 cm (9x13-inch) baking dish.
02 - Boil a large pot of salted water. Cook pasta until just al dente, approximately 2 minutes less than package directions. Drain and reserve.
03 - In the same pot, cover sweet potatoes with water and bring to a boil. Simmer for about 10 minutes until fork-tender. Drain and mash until mostly smooth.
04 - In a large saucepan, melt 28 g unsalted butter over medium heat. Add the finely chopped onion and cook until translucent, about 4 minutes. Incorporate minced garlic and cook for an additional minute.
05 - Stir in the all-purpose flour and cook for 1 minute, stirring constantly. Gradually whisk in the milk and heavy cream, ensuring a smooth, lump-free consistency.
06 - Add the mashed sweet potatoes, nutmeg, salt, and pepper to the saucepan. Cook, stirring frequently, for 3–4 minutes until the mixture is smooth and slightly thickened.
07 - Remove the saucepan from heat. Stir in the shredded Gruyère cheese and half of the shredded Parmesan cheese until fully melted and combined.
08 - Add the drained pasta to the cheese and sweet potato sauce. Mix thoroughly to ensure all pasta is coated.
09 - Pour the pasta and sauce mixture into the prepared baking dish. In a separate small bowl, combine the fresh breadcrumbs, melted butter, remaining Parmesan cheese, and optional chopped parsley. Sprinkle this topping evenly over the pasta mixture.
10 - Bake for 25–30 minutes, or until the topping is golden brown and the gratin is bubbling. Allow to rest for 5 minutes before serving.