Preheat your oven to 400°F (200°C) and lightly grease a 9×13-inch baking dish with a thin coating of extra virgin olive oil. Greasing the dish helps prevent the vegetables and cheese from sticking while encouraging the edges to become beautifully golden during baking. Allow the oven to fully preheat before placing the casserole inside so the vegetables roast evenly from the start.
Wash the zucchini and yellow squash thoroughly under cool running water and pat them completely dry with a clean kitchen towel or paper towels. Slice both vegetables into even ¼-inch-thick rounds using a sharp knife. Keeping the slices the same thickness ensures they cook at the same rate, giving you tender vegetables that still hold their shape instead of becoming mushy.
Place the sliced zucchini and squash into a large mixing bowl. Drizzle with the olive oil, then add the minced garlic, Italian seasoning, salt, and freshly ground black pepper. Gently toss everything together until every slice is evenly coated with the oil and seasonings. Take a moment to separate any slices that stick together so each piece is coated with the flavorful garlic and herb mixture.
Arrange the seasoned zucchini and squash in the prepared baking dish, creating slightly overlapping layers for an attractive presentation. Alternate the green zucchini and yellow squash if possible to add beautiful color to the finished dish. Avoid packing the vegetables too tightly, as leaving a little space between the layers allows heat to circulate and helps the vegetables roast evenly.
Evenly sprinkle the freshly shredded sharp cheddar cheese over the vegetables, making sure every section of the casserole is covered with a light, even layer. Freshly shredded cheese melts more smoothly than pre-shredded varieties and creates a creamy, bubbly topping with delicious golden edges.
Place the baking dish in the preheated oven and bake for 30–35 minutes, or until the zucchini and squash are tender when pierced with a fork and the cheese is completely melted with lightly browned spots. The vegetables should be soft but still hold their shape, while the cheese should be bubbling and fragrant. Check the casserole during the last few minutes to avoid overcooking, as zucchini and squash can become watery if baked too long.
If you enjoy an extra crispy, golden topping, switch the oven to broil and broil the casserole for 2–3 minutes. Watch it carefully during this step because the cheese can brown very quickly. Remove the casserole as soon as the top develops a beautiful golden color with slightly crisp edges.
Carefully remove the baking dish from the oven and let the casserole rest for 5–10 minutes before serving. This allows the melted cheese to set slightly and gives the vegetables time to absorb any remaining juices, making the casserole easier to serve while improving its overall texture.
Just before serving, sprinkle the casserole with fresh chopped parsley and basil for a burst of freshness and color. Add a squeeze of fresh lemon juice to brighten the rich, cheesy flavors, and finish with a pinch of crushed red pepper flakes if you enjoy a little heat. Serve warm as a comforting vegetarian main dish or alongside grilled chicken, turkey, fish, or your favorite healthy side dishes.