This is a bug that seems to always occur when switching from pistol to rifle when prone.
What happens is the following:When switching from pistol to rifle for the first time when prone, it causes the character to stand up momentarily and then go prone, then completing the switch to rifle.
This is very disruptive of gameplay, locking you in place and giving your position away.