Can it be because loading from script adds extra work on engine.
No. It's called only once when the scene becomes ready. And shouldn't be any different from setting the textures manually in the editor.
To use script you have to set frame number manually
Well, yes. You can do this from script as well though:
$TextureRect.texture.frames = 8
when i use script in the end of loop animation stops like a quarter of a second
I cannot reproduce this, works fine for me. If you upload a minimal example project somewhere and provide a link here, I can take a look.