"The Joystick library can only be used with a USB MCU" while using pro micro

It is strange. I notice you are using a very old hourly build of the Arduino IDE. I don't have any specific idea of why that would be a problem, but the hourly build might be anything. Please try it again using Arduino IDE 1.8.16:

Other than that, everything looks just the same as my system, but when I compile the sketch on my system there is no error.