Preheat the oven to 350°F (180°C).
Heat the olive oil in a large skillet over medium-high heat. Add the chopped onion and carrot and cook, stirring occasionally, until softened and translucent, about 3–4 minutes.
Add the minced garlic and cook for 30 seconds until fragrant, then add the tomato passata (or marinara) and all dried seasonings: dried Italian herb, oregano, sugar, ground fennel, garlic powder, onion powder, 1 teaspoon salt, and 1/2 teaspoon black pepper. Stir to combine.
Reduce heat to low and let the sauce simmer gently while you cook the pasta.
Bring a large pot of salted water to a boil. Add 1 tablespoon salt and the ziti and cook until the pasta is 2 minutes less than the package directions indicate. Reserve 1/3 cup of the pasta cooking water, then drain the pasta and return it to the pot.
Pour 2 cups of the simmered sauce into the cooked pasta along with the reserved pasta water and stir gently to coat.
Spread the sauced pasta evenly into a 9×13-inch (23x33 cm) baking dish. Dollop spoonfuls of the ricotta over the pasta, then pour the remaining sauce over the top. Sprinkle the shredded mozzarella and parmesan evenly over the surface.
Bake in the preheated oven for 25 minutes, until the cheese is golden and bubbling.
Remove from the oven and sprinkle with chopped parsley or basil if using, then serve.