Locks can only be added to the primary since it owns the encryption keys, so that part makes sense.
The zwave tweaker should work fine for this purpose. You will temporarily assign the trigger device, in this case the Cooper 9542 (the accessory switch) to the Z wave Tweaker DTH using the web interface to your smartthings account, which is called the IDE.
Then you will use the tweaker to set the associations. These will be stored in the firmware of the 9542.
At that point you can switch back to using the original DTH and everything will work fine.
Note that you don’t need to do anything at all with the master switch, the 9540. Just the accessory switch.
I’m not feeling well today, so I can’t go into more details on this, but the people in the Z wave tweaker thread will be glad to help you.
Before you start, you might want to read the following FAQ so you get familiar with the terminology and the basic concepts.
[OBSOLETE] FAQ: An Overview of Using Custom Code in SmartThings (SmartThings Classic, Groovy Code)
Good luck, it should work fine.