IK Solver Chain Length reverts back to 0 when changing between pose and object mode
I had a similar issue. I noticed that I had (probably accidentally) inserted a keyframe by clicking this small dot button right next to the &gt; arrow key which changed into a diamond shape. After clicking it again it removed the keyframe, turned back to a dot and the changed number was saved just fine

Another indication is that the Chain Length field was yellow / orange, instead of the regular grey, while that diamond icon was around.