Removing 'noise' / counter animation from FK chain

Hi, I’ve been using a script which re-rigs simple FK chain controls to be driven by a bunch of locators with aim constraints. With this I can easily create the pose I want. However there is a flaw whereby after baking, the result on the FK controls doesn’t respect having nice, intuitive rotations.
So while from the outside everything looks good (the mesh) - there’s actually a ton of noise and counter animation happening on loads of controls.

So one control might be 45 in rotateX, and another control down the chain be -45 rotateX, with no practical reason.

Here is a quick example. The top image being my current noisy result, and the lower image being my goal.

image

So I’m looking for a way where I can keep the integrity of the overall shape / pose, while cleaning up the noise. (Aaand if possible, I’d like to be able to run it on animation and keep ‘smooth’ results between keys)

I’ve been trying a bunch of stuff but everything feels a bit… lukewarm. So was just wondering if anyone had any suggestions on what to try?