Preheat oven to 400 degrees F.
To make the tomato sauce, heat the olive oil over medium heat in a large pan. Add the onion and cook for 5 minutes, or until tender. Stir in garlic, tomatoes, fennel seed, basil, oregano, and red pepper. Season with salt and black pepper and let simmer for about 30 minutes over low heat.
While the sauce is simmering, roast the vegetables. Place zucchini, yellow squash, eggplant, and red pepper on a large baking sheet. Drizzle with olive oil and season with salt and pepper. Toss. Roast for 25-30 minutes, or until vegetables are tender, stirring occasionally. When the vegetables are done roasting, set aside to cool and reduce oven temperature to 375 degrees F.
In a large pot, bring the milk, butter, sugar and salt to a light simmer. Slowly add the polenta to the pot, whisking constantly. Once it starts to thicken, trade the whisk out for a spoon and stir until the polenta pulls away from the sides of the pot. Add half of the Parmesan cheese to the polenta and stir to combine. Pour the mixture into a 2 quart casserole dish that has been sprayed with cooking spray. Top with the other half of the parmesan.
Evenly spread the roasted vegetables on top of the polenta. Spread the tomato sauce over the vegetables and top with grated mozzarella cheese. Place the pie in the oven and bake for 30-35 minutes, or until bubbly and the cheese is melted and slightly browned. Let rest for about 10 minutes. Cut into squares and serve warm.