Boil pasta in salted water until al dente. Reserve 3/4 cup cooking water, then drain.
Warm olive oil and butter in a large skillet over medium-high heat.
Sauté zucchini until golden and tender, 6–8 minutes, stirring occasionally. Season with some salt and pepper.
Stir in shallot and garlic. Cook 1 minute until fragrant, then add red pepper flakes.
Pour in 1/2 cup pasta water and simmer 2 minutes. Lightly mash some zucchini to thicken the sauce.
Lower heat. Add pasta and ricotta; toss until creamy. Mix in Parmesan, lemon zest, and juice. Splash more water as needed to coat.
Fold in basil. Taste and adjust salt and pepper. Serve hot with extra Parmesan.