Strange bug(?) I've Encountered with the Walk Animation

I’ve tried to create a sword walk animation but however, when I change the Animate script’s walk animation to my custom one it seems to bug out:

External Media

This is how it’s supposed to look:

External Media

At first I thought something was wrong with the rig or the animation, but after intensive testing I found out that the animation works completely fine if I used LoadAnimation instead of changing the WalkAnimationId:

External Media

However, this method is extremely buggy and inconvenient. If anyone could help me fix this problem I’d be extremely grateful. Thanks.

My Streamable links don’t seem to work. You have to download the videos to watch them. Oops.