For the Ricotta: Place ricotta in the center of a clean tea towel, thin kitchen towel, or double layer of cheesecloth. Gather towel into a bundle and twist tightly to enclose ricotta. Set over a large bowl to catch liquid. Let drain while preparing the remaining ingredients, twisting towel occasionally to encourage more liquid to drain.
For the Phyllo Dough: In a medium bowl, whisk together flour and salt. Add vinegar and 1 tablespoon of oil, then stir to combine. While stirring with a spoon, slowly add ⅓ cup water until a shaggy dough forms. Knead in the bowl, adding more water, 1 teaspoon at a time, as needed, until the dough is tacky but not sticky. Transfer to a work surface and knead until smooth, 2 to 3 minutes. Place dough in a small bowl, drizzle with remaining 1 teaspoon oil, turning to coat. Cover and let rest for 1 hour.
For the Vegetable Filling: Meanwhile, using a knife or mandoline, slice zucchini into ⅛-inch-thick rounds. As you work, transfer zucchini to a colander set in the sink or over a large bowl, sprinkling each layer with a total of 3 tablespoons kosher salt and tossing gently to distribute. Let stand while preparing the remaining ingredients until beads of liquid form on the surface, about 20 minutes.
Using a knife or mandoline, slice potatoes into ⅛-inch-thick rounds. In a medium bowl, stir together 2 cups water and 1 tablespoon kosher salt until dissolved. Add potatoes and let soak while preparing the remaining ingredients.
For the ricotta, twist the towel to expel as much liquid as possible from the ricotta. Transfer ricotta to a medium bowl and stir in mint and/or parsley, 1 teaspoon kosher salt, oregano, and black pepper until combined. Set aside.
Rinse zucchini well under cold running water to remove excess salt. Line a rimmed baking sheet with paper towels or a clean kitchen towel, then spread the zucchini on it. Pat dry. Drain potatoes and transfer to a second towel-lined rimmed baking sheet. Pat dry.
Adjust oven rack to middle position and preheat oven to 400°F (205°C). Transfer dough to a lightly floured work surface and knead briefly to incorporate any excess oil. Roll into a roughly 15-by-11-inch rectangle.
To Assemble and Bake: Grease a 13-by-9-inch metal baking pan with 1 tablespoon of olive oil. Arrange half of potatoes in an even layer, followed by half of zucchini. Drizzle with 1 tablespoon olive oil, then spread half of ricotta mixture evenly over the vegetables. Sprinkle with half of the Gruyère or Comté. Repeat with remaining potatoes, zucchini, 1 tablespoon olive oil, ricotta mixture, and cheese.
Lay the prepared phyllo over the filling, tucking any overhang inside the pan. Drizzle with remaining 3 tablespoons (45 ml) olive oil and brush to coat evenly. Sprinkle with sesame seeds, if using, and, using a sharp knife, score the top of the dough into 8 or 12 portions.
Set pan on a rimmed baking sheet and bake until phyllo is deep golden brown and vegetables are tender when pierced with a paring knife or cake tester, 60 to 70 minutes. If your oven has a convection setting, switch to convection for the final 10 to 15 minutes to encourage even browning, if needed.
Let it rest for at least 20 minutes before slicing and serving. Serve hot, warm, or at room temperature.