EDIT:
I think this may be your problem:
In the XIM software, do not map the physical mouse button you're using to program your macros in LGS.
My first, probably hard to understand response, follows:
So you need to separate out the button mapping in the XIM4 software from the commands in your LGS. RML has secondary mappings to the joystick buttons, which are the keyboard mappings he uses when programming macros.
For instance, he has MScrollDown mapped on Primary to his Y button (triangle on PS4). So that's what he uses to switch weapons. He as KPad0 mapped on Secondary to his Y button (triangle on PS4). So he uses KPad0 in the LGS software (press KPad0, hold 1.8s, release KPad0), mapped to the K1 button on the mouse. So when he presses K1 (which is not mapped in the XIM software), the XIM will see the macro that is being run from the on board mouse memory, and his Heavy Weapon will be equipped.
Does that make sense? I think you might be mapping your programmed mouse button from LGS to XIM, so XIM will interpret that before the macro ever has a chance to work.