No complete event if I change the IMC while keeping some keys pressed?

I use Enahnced Input in my project. I have two Input Actions (Foo_Started and Foo_Completed), in the base IMC, key E is bound to both of them, and in another IMC, key E is bound to another action, which means Foo_Started and Foo_Completed will not be triggered if I change to the new IMC. However, if I change the IMC while pressing E, the Foo_Completed will not be triggered, except I call FlushPressdKeys() right one tick before changing IMC. For the reason, I found something as below:

IEnhancedInputSubsystemInterface::RebuildControlMappings()
{
...
for (const UInputAction* Action : RemovedActions)
{
       PlayerInput->ActionInstanceData.Remove(Action);
}

this code will remove useless actions immediately. What I expect is that these useless input actions will be “released” if the bound keys are pressing or triggering.