For the sauce:
1 tablespoon olive oil
1/2 medium yellow onion, small dice
1 medium garlic clove, finely chopped
1/8 teaspoon red pepper flakes
1 (14.5-ounce) can tomato sauce
1 tablespoon capers
1/2 teaspoon kosher salt, plus more for seasoning
For the filling:
1 pound large-curd cottage cheese
1 cup finely grated Parmesan cheese (about 3 ounces)
1/2 teaspoon kosher salt
1/4 teaspoon freshly ground black pepper
For the vegetables:
1 1/2 pounds zucchini, ends trimmed and sliced lengthwise 1/4 inch thick
3 tablespoons olive oil
1 3/4 pounds cremini mushrooms, stems trimmed and sliced 1/4 inch thick
Freshly ground black pepper
8 ounces frozen artichoke hearts, thawed, patted dry with paper towels, and coarsely chopped
1 tablespoon all-purpose flour
1 pound shredded whole-milk mozzarella cheese (about 4 cups)
Heat the oven to 375°F and arrange the racks to divide it into thirds.
Heat the oil in a medium saucepan over medium heat until shimmering. Add the onion, season with salt, and cook, stirring occasionally, until softened and just beginning to brown, about 6 minutes. Add the garlic and pepper flakes and cook, stirring occasionally, until fragrant, about 1 to 2 minutes.
Add the tomato sauce, capers, and measured salt, stir to combine, and bring to a boil. Reduce the heat to medium low and simmer until the flavors meld and the sauce has slightly thickened, about 10 minutes. Remove from the heat. Meanwhile, make the filling and cook the vegetables.
Combine all of the ingredients in a medium bowl; set aside.
Place the zucchini slices in a single layer on 2 baking sheets, overlapping the slices slightly as needed. Roast until softened and pliable, about 10 to 15 minutes. Place the baking sheets on wire racks and set aside to cool. Move the upper rack to the middle of the oven.
Heat 1 tablespoon of the oil in a large frying pan over medium-high heat until shimmering. Add half of the mushrooms, season with salt and pepper, and cook, stirring rarely, until golden brown, about 6 minutes. Transfer to a large bowl. Add another tablespoon of the oil to the pan and repeat with the remaining mushrooms.
Add the remaining tablespoon of oil to the pan and heat over medium-high heat until shimmering. Add the artichoke hearts, season with salt and pepper, and cook, stirring occasionally, until lightly browned, about 4 minutes. Transfer to the bowl with the mushrooms. Sprinkle the flour over the vegetables and toss to evenly coat.
Add 1 1/4 cups of the sauce to the mushroom-artichoke mixture and toss to evenly coat; set aside.
Spread the remaining tomato sauce in a thin layer over the bottom of a 13-by-9-inch baking dish.
Scatter a quarter of the mushroom-artichoke mixture over the sauce in an even layer. Evenly place a quarter of the zucchini slices in a single layer over the mixture. Using a small spoon, dollop a third of the cottage cheese filling evenly over the zucchini and flatten the dollops with the back of the spoon (the filling will spread out more as it cooks). Evenly sprinkle a quarter of the mozzarella over the cottage cheese filling.
Make 2 more layers of the mushroom-artichoke mixture, zucchini slices, cottage cheese filling, and mozzarella. Make a final layer with the remaining zucchini slices, then the mushroom-artichoke mixture, and finally the mozzarella (switching up the order keeps the zucchini from burning under the cheese).
Bake uncovered until the sauce is bubbling around the edges and the top is browned, about 40 minutes. Remove the pan to a wire rack and let cool for 30 minutes before slicing.