Why is the animation so buggy?

So quite simply I just want the attack animation to run smoothly then once ended return to the idle animation but for some reason when the attack animation plays it’ll sometimes go crazy as if the animation is playing 100 times at once and at the end of the animation it for some reason moves to the original t-pose and THEN the idle animation starts again, I have the attack animation set to action and not to loop but apart from that I don’t know what I’m doing wrong.
Untitled video - Create and share your videos with Clipchamp (Video of the issue)
If you know hot to fix it please tell me.