Hiya,
Just encountered this bug/glitch where the auto detect for the controller/keyboard is freaking out.
As soon as I stop moving the mouse or pressing keys on the keyboard it jumps back to gamepad and the camera flips up and spins straight away making it very hard to play.
The only way around it has been to change the Active Controller setting to just Keyboard & Mouse rather than auto detect.
I have no gamepad/controller plugged in or active and the mouse and keyboard are generally working fine on the desktop and on other games like Minecraft as well.
I've got a video recording but I can't upload .mp4 files here unfortunately.
**EDIT**
I did have a PS4 controller plugged in via USB and didn't realise at the time and this seems to be what caused the issue.