My character appears to be jumping off the ground when switching between crouching and idle animations. How can I fix this?

Many ways to do it, but a common method is when the player crouches or un-crouches, Lerp the height of the capsule component somewhat in sync with the animation.

It will be additional states in your character, something like: walking >> crouching >> crouched > uncrouching >> walking.