Adjust oven rack to middle position and preheat to 350. Spray a 5×9-inch loaf pan with nonstick cooking spray. Make a 2-part sling out of parchment, and put it in the pan, using the spray to help it stick. Spray the parchment with nonstick cooking spray, and sprinkle 1/2 cup of Parmesan evenly in the bottom of the pan.

Fry the bacon in a medium nonstick skillet over medium heat until browned and crisp, about 8 minutes. Using a slotted spoon, transfer bacon to a paper towl-lined plate. Pour off all but three tablspoons of the fat from the skillet. Add the onion to the skillet and cook, stirring frequently, until softened, about 5 minutes, then set aside.

In a large bowl, whisk together flour, baking powder, cayenne, salt, and pepper. Mix in the Gruyère cubes, bacon, and onion, coating the pieces completely with flour.

In a separate bowl, combine milk, egg, and sour cream. Pour the wet ingredients on top of the dry, and fold together with a rubber spatula to combine. The batter will be heavy and thick.

Scrape the batter into the loaf pan, smoothing the surface with the spatula. Sprinkle the remaining 1/2 cup of Parmesan evenly over the top.

Bake for approximately 50-60 minutes, or until a toothpick or skewer inserted into the center comes out clean. Cool in pan 10-20 minutes, then de-pan and cool for another 30-45 minutes. Cut into slices and serve warm.