Can you backup the file
/opt/retropie/configs/all/retroarch-joypads/Twin_USB_Joystick.cfg
then delete it and make sure that directory is empty.
Then run the retropie-setup script and choose the register a retroarch controller option?
That will write a file back to the directory above – can you try that one out (and post the file)?
RetroPie help guides: https://goo.gl/Yfy8kj