Preheat your oven to 375°F (190°C) to prepare it for baking.
Bring a large pot of salted water to a boil. Add the penne pasta and cook according to package instructions until just al dente. Drain the pasta and set it aside.
In a large skillet, heat the olive oil over medium heat. Add the diced onion and sauté for about 3-4 minutes, or until it becomes translucent and fragrant.
Stir in the minced garlic, chopped bell pepper, and diced zucchini. Cook for an additional 5 minutes, stirring occasionally, until the vegetables are tender and vibrant.
Add the diced tomatoes (with their juice) to the skillet, along with the dried oregano, basil, red pepper flakes (if using), and a pinch of salt and pepper. Allow the mixture to simmer for about 5 minutes to develop the flavors, stirring occasionally.
In a large mixing bowl, combine the cooked pasta with the vegetable mixture. Add the ricotta cheese and half of the shredded mozzarella, mixing thoroughly until everything is well combined and coated.
Pour the pasta mixture into a greased 9x13-inch baking dish, spreading it out evenly to ensure even cooking.
Sprinkle the remaining mozzarella cheese and all of the grated Parmesan cheese evenly over the top of the casserole.
Cover the baking dish tightly with aluminum foil and place it in the preheated oven. Bake for 25 minutes. After this time, carefully remove the foil and continue to bake for an additional 10-15 minutes, or until the cheese is bubbly and a golden brown on top.
Once baked, remove the casserole from the oven and let it cool for a few minutes. If desired, garnish with fresh basil leaves for a pop of color and flavor just before serving.