Arrange a rack in lower third of oven and preheat oven to 350 degrees. Generously butter an 8x8x2" glass baking dish. Sprinkle evenly with 2 tablespoons Parmesan cheese.
Melt 1 tbsp butter in a medium skillet over medium heat. Add mushrooms; cook, stirring occasionally, until golden brown and skillet is dry, 5-7 minutes. Season to taste with salt and pepper. Transfer mushrooms to a small bowl; set aside. Wipe skillet clean.
Using the large holes on a box grater, coarsely grate corn kernels from cobs into a large bowl (you should have about 2 cups).
Melt remaining 2 tablespoons butter with oil in same skillet over medium-low heat. Add onion; cook, stirring often, until soft and translucent (do not brown), 8-10 minutes. Stir in flour. Add grated corn; increase heat to medium. Cook, stirring often, until most of liquid evaporates and corn is bright yellow, 2-3 minutes. Add cream; cook, stirring frequently, until well blended and most of liquid has evaporated, about 3 minutes. Stir in milk, ham, 3/4 cup cheese, and reserved mushrooms. Cook, stirring often, until flavors begin to meld, 1-2 minutes longer. Season with salt and pepper.
Transfer corn mixture to a large bowl. Season eggs with salt and pepper. Add to corn mixture; stir gently to blend. Pour into prepared baking dish; sprinkle with 2 tbsp cheese. Set dish into a roasting pan; place in oven. Pour hot water into roasting pan to come halfway up sides of baking dish (this will prevent egg from curdling).
Bake until pudding is JUST set in the center (center will jiggle very slightly when dish is nudged), 40-45 minutes. Use a ladle or turkey baster to remove about half the water from roasting pan to prevent any hot water from spilling when the pan is lifted from oven. Remove roasting pan with pudding from oven. Remove baking dish from oven.
Preheat broiler. Return pudding to oven; broil until top is golden brown in spots, 2-3 minutes. Let stand at least 15minutes and up to 30 minutes before serving,.