Preheat your oven to 375°F (190°C).
Heat olive oil in a pan over medium heat. Add minced garlic and sauté until fragrant.
Add thinly sliced onions and cook until they turn translucent.
Layer half of the sliced zucchinis and tomatoes in a greased casserole dish.
Sprinkle with half of the chopped basil, oregano, thyme, red pepper flakes, salt, and pepper.
Create another layer with the remaining zucchinis and tomatoes, followed by the rest of the herbs and seasonings.
Top the casserole with dairy-free mozzarella cheese (if using) and breadcrumbs.
Cover the casserole dish with aluminum foil and bake for 25 minutes.
Remove the foil and bake for an additional 10 minutes or until the top is golden and the vegetables are tender.