It took me a bit to get LM(layer, mod) to work because I didn't see in the documentation what values are expected for 'mod'. I expected it to be KC_LSFT, for example, which compiled fine but didn't work. After some digging through the sources I found that mods_bit is meant, and the code for LSFT is 2. Maybe this could be improved in the documentation.
Until documentation is updated, those experiencing this issue can find the mod codes in
./tmk_core/common/action_code.h
Most helpful comment
Until documentation is updated, those experiencing this issue can find the mod codes in
./tmk_core/common/action_code.h