Use an animation to rotate a cube 180 degrees

I have a cube set to transition from an empty Idle animation to trigger into a 180 degree turn animation. The problem is when root motion is applied the cube will rotate slightly less than 180 degrees and offset and completely get off track. I need a fix that will rotate the cube exactly 180 degrees on a button push.

The rotation should work, maybe another animation is interfering with it or you stop the animation too early.
A workaround would be to have a coroutine wait for the time the animation takes and then set the rotation to 180. You could also handle the whole rotation through a coroutine rather than through an animation, using Mathf.Lerp and Mathf.Slerp.