Preheat oven to 350°F. Coat a 11-x 7-inch or 2 ½-quart baking dish with cooking spray.
Heat oil in a large skillet over medium. Add onions, and cook, covered, stirring occasionally, until soft and starting to brown, 10 to 12 minutes. Uncover; stir in salt and pepper. Re-cover; cook, stirring occasionally, until golden brown and very soft, 8 to 10 minutes.
Uncover. Stir in butter and garlic, and cook, stirring constantly, until fragrant and butter has melted, about 1 minute. Sprinkle flour over onion mixture, and cook, stirring often, until well incorporated, about 1 minute.
Stir in broth, and bring to a simmer over medium, scraping bottom of skillet to release browned bits.
Remove skillet from heat; stir in peas. Let cool 5 minutes.
Meanwhile, stir together chicken, sour cream, mayonnaise, and parsley in a large bowl.
Add onion mixture to chicken mixture in large bowl, and stir until well combined. Transfer mixture to prepared baking dish, and sprinkle with fried onions, mozzarella, and Gruyère.
Bake in preheated oven until cheese is melted and sides are golden brown, 25 to 30 minutes. Remove from oven, and let cool 5 minutes. Serve.