Preheat the oven to 350°F. Lightly spray a 9x13-inch casserole dish with nonstick cooking spray and set aside.
Bring a large pot of salted water to a boil and cook the ditalini pasta according to the minimum time on the package directions for al dente consistency. Drain and set aside.
Return the pot to the stovetop and set it to medium-high heat. Add olive oil, then sauté carrots, celery, and shallot for about 3 minutes, stirring frequently, until slightly tender. Add zucchini and cook for 1 minute, then stir in garlic and cook for 30 seconds.
Reduce heat to medium. Gently stir in kidney beans, cannellini beans, diced tomatoes (with liquid), tomato sauce, green beans, Parmesan cheese, Italian seasoning, salt, and black pepper. Adjust seasonings to taste.
Transfer the mixture to the prepared casserole dish. Sprinkle evenly with mozzarella cheese, cover with aluminum foil, and bake for 20 minutes. Uncover and bake for an additional 10 minutes, or until the cheese is melted and bubbly.
Garnish with chopped parsley and serve warm.