I have the same issue, but I have not tried the button in SNES emulator, only Sega Genesis. I have tested Master System and N64 and it is not working.
Is there any file that may be overriding the main one? All my other retroarch.cfg files are empty, I have added that line in /home/pi/RetroPie/configs/all
Edit: After searching for a while, I found this thread. I changed the Master System emulator to PicoDrive and it works, so it seems that some emulators are ignoring the RetroPie/configs/all/retroarch.cfg file.
To change the MS emulator to PicoDrive, change the .emulationstation/es_systems.cfg Master System COMMAND line to the following:
Necessary and Functional
These cookies are placed to make it possible to analyze this website (with Google Analytics) and optimize for the purpose of a.o. the usability.
Cookie names: _ga, _gat, _gid
These cookies are placed to show advertisements (of Google AdSense) and to get these close to your interest.
Cookie names: id, IDE, FLC, DSID, SNID, NID
These cookies are required to show the cookie notification bar, remember your cookie acceptance choice and apply this choice.
Cookie names: privacy_embeds, wpca_consent, woocommerce_cart_hash, woocommerce_items_in_cart, wp_woocommerce_session_, wp-settings-1, wp-settings-time-1