I stripped everything out and started again. I can get a gamepad showing in Windows using the Joystick Test. As soon I uploaded the basic project yours is based and with Joystick.h loaded it compiles and loads but then no Gamepad in Windows. Could this be a problem with having the latest version of Arduino. I read somewhere the versions are not backwards compatible.
This started because I couldn't get another code to work. I could see it in control panel/ then windows test software and even saw it in my flight sim calibrator but the encoder worked in Serial Monitor but not in the sim.
Not sure Arduino is for me.