Ahh that is good news
Dont worry about the gun ID numbers in mame they do not really matter what number they are detected as.
It only matters that gun x is assigned to player 1 and gun y is player 2.
If you have fixed the windows usb device ID’s then you should never need to change them.
So regarding the M2 emu....
This one is a pain in the ass to set up and involves some serious head aches and tinkering.
Firstly I seem to remember it only runs properly on the older version of M2 emu.
Secondly you need to make changes to the config file to enable multi mouse support.
Thirdly you need demul shooter running before you load the emulator.
Also I remember some games had to have the guns enabled or calibrated in the in game test menu before they would work so be sure to press your test button and have a look through the options for each game.
Thats all I can think of right now off the top of my head but I will look at the config file thing later for more pointers.