Prep the oven and pan: Heat your oven to 400°F (200°C). Lightly grease a 9x13-inch baking dish with nonstick spray or a thin coat of olive oil.
Slice and salt the zucchini: Cut the zucchini into even 1/4-inch rounds. Spread them on a sheet pan and sprinkle with about 1 teaspoon kosher salt.
Let them sit for 15–20 minutes to draw out excess moisture.
Pat dry: After resting, blot the zucchini well with paper towels. This step helps prevent a watery casserole and keeps the texture pleasant.
Sauté the aromatics: Warm 2 tablespoons olive oil in a large skillet over medium heat. Add onion and cook 3–4 minutes until softened.
Stir in the garlic and cook 30 seconds more until fragrant.
Season the sauce: Pour in the marinara, Italian seasoning, and red pepper flakes if using. Simmer for 3–5 minutes to let the flavors meld. Taste and adjust with black pepper as needed.
If your sauce is very tart, a tiny pinch of sugar can balance it.
Par-cook optional veggies: If using mushrooms or bell peppers, toss them in a dry skillet over medium-high heat for 3–4 minutes to release moisture and soften slightly. This keeps the casserole from getting soggy.
Layer one: Spoon a thin layer of sauce on the bottom of the baking dish. Arrange half the zucchini rounds in a snug, overlapping layer.
Scatter half the sautéed veggies (if using), half the olives, and half the pepperoni over the zucchini.
Cheese it up: Sprinkle half the mozzarella and a couple tablespoons of Parmesan over the first layer.
Layer two: Repeat with remaining zucchini, sauce, veggies, olives, and pepperoni. Top with the rest of the mozzarella and the remaining Parmesan.
Bake uncovered: Place the dish in the center of the oven and bake 20–25 minutes, until the cheese is melted and bubbling and the edges are lightly browned. If you want a deeper golden top, broil for 1–2 minutes at the end, watching closely.
Rest and garnish: Let the casserole sit for 10 minutes to set.
Scatter chopped basil or parsley over the top before serving.
Serve: Cut into squares and serve warm. A simple green salad or garlic bread makes a perfect side.