If you set the threshold to 0.5% the problem goes away as a short-term fix… I’ll look at why the threshold is a little off in this case.
Note that the threshold is also causing it to not change the enchant on your feet, which eats up some of the available “room” for it to save gold, though in this case 0.25% should be enough to leave the gems as-is too.
The swap in gems is an extremely small difference – in rare cases the optimizer will get into a state where it can’t “decide” between two nearly identical solutions. The fact that your inventory and equipped gear changed between optimizations gives it a slightly different starting point, and thus it will sometimes find that slightly different solution.
In most cases (like this one) those two solutions are functionally identical – so close in value that nobody could really say which is better. The gem+enchant threshold is meant to be a good way to avoid wasting time/gold on tiny changes, so we’ll try to get it to handle this case better. My guess is there’s something going on with how it is trying your original gems and its interaction with the unique gem bonus.