Preheat the oven to 350°F and grease a 9x13-inch baking dish.
Bring a large pot of lightly salted water to a boil. Add the sliced squash and chopped onion; boil for 8–10 minutes, until fork-tender.
Drain the squash and onion in a colander and let sit for 5 minutes, pressing gently with a spoon partway through to release excess water.
In a large mixing bowl, whisk together the eggs, sour cream, 3 tablespoons of melted butter, half the shredded cheddar, salt, and pepper.
Fold the drained squash and onion into the egg mixture until evenly coated.
Pour the mixture into the prepared baking dish and spread into an even layer. Sprinkle the remaining shredded cheddar evenly over the top.
Crush the Ritz crackers into coarse crumbs and toss with the remaining 3 tablespoons melted butter. Scatter evenly over the cheese layer.
Bake for 30–35 minutes, until the topping is deep golden brown and the custard is set (no jiggle in the center).
Let the casserole rest for 10 minutes before serving.