This is still an issue.
My controller had a configuration under autoconfig/drivername/mymodel.cfg, but you can generate one easilly via settings, input, retropad binds, port #x controls,save controller profile.
Then you can edit the generated file and comment:
input_l2_btn = "6"
input_r2_btn = "7"
like:
_input_l2_btn = "6"
_input_r2_btn = "7"
…and finally add:
input_l2_axis = “+5”
input_r2_axis = “+2”
+2 and +5 works for me, you may have different values.
That way the configuration will be tied to that specific controller and not system wide like when editing retroarch.cfg.
Indeed, i’ve found that everything you throung in it takes priority over the single controller profiles (wth!), so it is not only something to avoid, but if the above method is not working for you, you may want to take a look in that file for likes like:
input_player1_l2_btn = "5"
input_player1_l2_btn = "6"
and ensure they are set to nul
input_player1_l2_btn = "nul"
input_player1_l2_btn = "nul"
…or just delete them.