Preheat the oven to 350 degrees F (175 degrees C). Spray a 2-quart casserole dish with cooking spray.
Mix Parmesan cheese, mayonnaise, onion, bell pepper, and eggs together in a large bowl. Add zucchini, salt, and pepper and mix until well combined. Transfer to the prepared baking dish and dot with butter.
Bake in the preheated oven until zucchini is fork-tender and top is golden brown, about 45 minutes.