Animator Controller Changes Bone Manipulation Results by Script

I’m currently working on IK script.
I need to use generic model, so I can’t use Mecanim IK. Here’s my code.Gist

I’m facing a problem that when I attach Animator Component (with proper Animator Controller and Avatar)to the 3D model, IK script does not work correctly.
Without Animator, the result is as expected.

However, with Animator attached, IK result changes and doesn’t work correctly. The result is shown in figure below. (took on the same condition as previous picture except that Animator is active.)

I can’t figure out why whether Animator Component is attached or not affects the result of IK.

What is the cause of this problem?

I found that Animator Controller resets bone transform values (position, rotation, local position and local rotation) every frame. Because of that, solver function can’t use calculation result of previous frame, which impaired accuracy.

I modified script so that solver function can use result of previous result (see gist), and it works well so far.