looks very much like the switch release triggers another interrupt that is not easily serviceable
That's one of the reasons why it's usually better NOT to use interrupts to handle things like button presses and just poll it.
In your main loop you can still use the IOC IF flag to check and see if you need to look for a key press, but there you can add debounce delays, etc... things that don't really belong in an ISR.

Polling for it in the main loop also gets around the problems created by getting interrupted in the middle of things, stuff like I2C, displays, serial ports, etc. that can't really get interrupted if they're used in both main and the ISR.