How to animate weapon movement on the weapon animation itself?

I am trying a new method with the arms fixed to left and right IK points on each weapon, and instead of using arms animation, the idea is to move the weapon around.

I added keyframes at the start, middle and end of the pistol firing animation, rotating the root back 20 degrees in the middle, and then centred in the start and the end.

When I play the animation upon firing, the trigger and bolt move as they already did, but the pistol doesn’t rotate.

I already tried to enable root motion and am working in UE5.

Any ideas?