Preheat oven to 350. Cook onions and garlic in oil until soft. Turn off heat; mix in chicken, corn, olives, chilies, and pepper flakes. Remove tops from bell peppers, then slice in half lengthwise, remove seeds and membranes, and arrange around edge of casserole. Add cheese to chicken mixture and move immediately to casserole. Bake 45 minutes.