Preheat the oven to 400 degrees F (200 degrees C). Grease a 9×13 inch baking dish, and set aside to cool slightly.
Melt butter in a skillet over medium heat. Add the onions, and saute until tender. Remove from heat, stir in the sour cream, and set aside.
In a large bowl, stir together the cornbread mixes, eggs, buttermilk, corn, salt and pepper until smooth. Spread evenly in the prepared pan. Stir half of the shredded cheese into the sour cream and onion mixture, then spread over the batter in the pan. Sprinkle remaining cheese over the top.
Bake for 25 to 30 minutes in the preheated oven, until nicely browned and firm.