Heat oven to 475ºF (246ºC) with rack set in middle position.
Toss 8 ounces mushrooms with 1 tablespoon olive oil and season with ¼ teaspoon salt and ¼ teaspoon pepper.
Roast mushrooms, rotating halfway through, until browned and tender, about 30 minutes. Set aside.
Meanwhile, heat a large skillet over medium. Add 2 teaspoons olive oil and heat until shimmering. Add corn (cut from 2 ears of corn) and season with salt; cook until vibrant in color, 6–8 minutes. Add 3 sliced cloves garlic and cook until starting to lightly toast, about 4 minutes, (add a splash of water if pan gets dry). Scrape corn into a bowl and set aside to cool.
Add 2 teaspoons olive oil to now empty pan over medium-high heat. Add 12 ounces sliced zucchini and season with ½ teaspoon salt and ¼ teaspoon pepper. Cook, stirring occasionally, until tender and starting to brown, 8–10 minutes. Remove from heat and set aside.
Meanwhile, bring a large pot of water to a boil. Season generously with salt and add 4 ounces pasta; cook until al dente according to package instructions. Reserve 1 cup pasta water then drain and set pasta aside.
Transfer ½ cup cooked corn to a blender along with ¼ cup pasta cooking water and 2 tablespoons ricotta; blend until smooth. Season with salt and pepper to taste.
In a small bowl, combine remaining ¼ cup + 2 tablespoons ricotta, grated zest of ½ a lemon, and ¼ teaspoon red pepper flakes; season with ¼ teaspoon salt.
Add cooked mushrooms (and all the crispy bits!) and cooked corn to pan with zucchini; stir to combine. Add cooked pasta and puréed corn sauce and gently toss to combine. Stir in half the basil and juice of half a lemon. Transfer to a serving bowl and dollop ricotta mixture over top. Sprinkle with basil and serve.