I have an app that creates and builds a custom button, using the metadata api (using the Apex Wrapper for the Salesforce Metadata API: https://github.com/financialforcedev/apex-mdapi). The button is then installed on various page layouts, also using the metadata api.
This all works fine in Classic. In Lightning, it works fine on some older test organizations that were created several months ago. However, it does not work on a new developer Organization that I just created.
The only difference between the two organizations that I can see, is that in the new Org, in which this doesn't work, the page layout configuration section titled "Salesforce Mobile and Lightning Experience Actions" is populated, whereas in the older org, in which this does work, that section is empty. I have done nothing to explicitly populate this section. I notice, in the new Org, that if I manually add the button in question to this section, then it starts to work properly.
Why would these organizations behave differently? I don't want to have to have my app users manually configure this button by adding it to the "Salesforce Moblie and Lightning Experience Actions" section of the page layout. Is there a way to have this added to this section with the metadata API?
Any insight is greatly appreciated