This error message have nothing to see with your pad but it's a problems with your roms for the game "Sonic Wings 2"
You can look in the zip file, I think you miss some files, not same version between the mame version and the rom version.
If it work on stand alone mode and not in mgalaxy it's generally a problem with executable file (because you can have configuration problem with same executable but never versions problems)