Preheat oven to 400ºF (200ºC). Dice red onion, zucchini, yellow squash, and bell pepper into 1-inch pieces.
Spread diced vegetables on a baking sheet, drizzle with olive oil, salt, and pepper. Toss to coat.
Roast vegetables for 45 minutes, stirring halfway, until soft and caramelized.
Finely dice yellow onion and sauté in a pot with butter until soft. Add crushed tomatoes and stir.
Simmer sauce for about 30 minutes while vegetables finish roasting, stirring occasionally.
Boil penne pasta in salted water until tender. Drain, then return to pot.
Stir 1 cup of red sauce into the drained penne. Combine roasted vegetables with the remaining red sauce.
Layer the casserole: half the sauced penne, half the ricotta mixture, half the roasted veggie sauce. Repeat layers.