In this vegetable-centric (and gluten-free) dish, zucchini takes the place of the usual pasta. You can use green or yellow squash, or both. A handheld slicer makes quick work of cutting the squash.
Line 3 rimmed baking sheets with paper towels and arrange zucchini in a single layer on top. Sprinkle with 1 1/2 tsp. salt and set aside 30 minutes.
Meanwhile, heat a grill to medium (350° to 450°). Heat 1 tbsp. oil in a medium frying pan over medium heat. Add shallot and garlic and cook, stirring constantly, until beginning to brown, about 2 minutes. Add corn and thyme and cook until corn is just hot, 2 to 3 minutes. Transfer to a medium bowl. Stir in ricotta, half of parmesan, the egg, basil, chives, pepper, and remaining 1/4 tsp. salt.
Preheat oven to 375°. Press water out of zucchini with more paper towels and remove all paper towels from baking sheets. Brush zucchini all over with remaining 2 tbsp. oil. Grill half of zucchini, turning once, until grill marks appear, 2 to 4 minutes; transfer to rimmed baking sheets as cooked. Repeat with remaining zucchini.
Butter bottom of a 9- by 13-in. baking dish with 1/2 tbsp. butter. Arrange a quarter of zucchini ribbons crosswise in bottom of dish, overlapping slightly. Evenly spread a third of corn-ricotta mixture over zucchini. Repeat process 2 more times, ending with zucchini. Sprinkle remaining parmesan on top and dot with remaining 1 tbsp. butter.
Bake until lasagna turns golden brown, about 45 minutes, rotating dish halfway through for even browning. Let rest 20 minutes before serving.
Make ahead: Through step 4, up to 1 day, chilled; bake about 55 minutes.