Shadowphile Why sprite though? Use another texture rect, so they bot have the same positioning system. You can use animated texture on a texture rect.
Or if you prefer sprites, use sprites for both.
Btw the sprite position you set in the script is not correct in respect to texture rect.
Also, the texture rect is inside a scaled panel container that affect its layouting behavior. What do you need that panel for? If you need it to control the overall size, don't scale it, change it's size instead. Look a bit into how Godot's control layouting system works.