Preheat your oven to 425°F (220°C). Toss the eggplant cubes and zucchini slices with 3 tablespoons of olive oil, 1 teaspoon salt, and ½ teaspoon black pepper. Spread them in a single layer on a large baking sheet (use two sheets if needed to prevent overcrowding).
Roast in the preheated oven for 25-30 minutes, tossing halfway through, until the vegetables are golden brown and slightly crispy on the edges. The eggplant should be tender but not mushy.
While the vegetables are roasting, heat the remaining tablespoon of olive oil in a large skillet over medium heat. Add the diced onion and cook until translucent, about 5 minutes. Add the minced garlic and cook for another 30 seconds until fragrant.
Add the diced tomatoes, tomato paste, dried herbs, and red pepper flakes (if using) to the skillet. Stir to combine and let simmer for about 10 minutes until slightly thickened. Season with salt and pepper to taste.
Meanwhile, bring a large pot of generously salted water to a boil. Cook the pasta according to package instructions until al dente. Reserve 1 cup of pasta water before draining.
Add the roasted eggplant and zucchini to the tomato sauce, gently folding to maintain some texture. Add the drained pasta to the sauce and toss to coat, adding a splash of reserved pasta water if needed to create a silky consistency.
Remove from heat and stir in most of the fresh basil. Serve in warm bowls topped with grated Parmesan cheese and the remaining fresh basil. A final drizzle of high-quality olive oil elevates the dish to restaurant quality.