Is there a way to create infinite clip of transform of the object on runtime?

We are trying to create Timeline on runtime.
The animation track is working well.
The transform track we try to using infinite-clip to control position and rotation. It seems working well. But only in the editor. After we build the transform track doesn’t work at all.

We receive this in the log file.

Can’t use AnimationClip::SetCurve at Runtime on non Legacy AnimationClips
(Filename: C:\buildslave\unity\build\Modules\Animation\AnimationClip.cpp Line: 1297)

In document says SetCurve doesn’t work with non-legacy and non-editor.

But, is there any workaround?
using clip.legacy = true before SetCurve does not work even if on editor.

No, there isn’t. It is a limitation of the animation system. The best alternative is a custom track that writes directly to a transform using Animation Curves, but that won’t interact as well with the animator as an infinite track.

Thank you very much.
Maybe we need to use the native method by mapping transform with time from scripts.