Help with Inverse Kinematics and limiting motion?

I’m trying to create a robotic rig where some pieces can only rotate in specific axis, specifically the arms. If I don’t use IKs, the bones work just fine with bone constraints with local rotation limiting. IKs for some reason ignore that, and I’ve tried to use the Inverse Kinematics tab under the Bone Properties, however some bones just ignore it. I’m happy to attach images/gifs to explain it better.

Thanks!

Use LimitRotation constraint after IK constraint in [bone constraint tab]

I already tried that, IKs ignore that

Attach the file

IK constrained bones have their rotation limits set under the Bone tab. IK constraint is always applied last, so any Limit ___ constraints won’t affect anything.