Single bone IK's do not get resolved correctly
In order to fix the flipping you need to add a dummy parent bone to the bone you want to IK, Then create an IK manipulating those two bones (dummy parent, and bone you want to IK)
Here pink has one bone which is IK, and Green has two bones which behaves like a one bone IK
Loading Image
And when flipped you can see green is still correct
Loading Image