Hello,
When certain Custom Layouts are enabled for the Single Product, any changes made under Theme Settings will not automatically take effect, as the custom template overrides the global settings.
In this scenario, you will need to adjust the layout directly within the custom template. Your current approach—adding two galleries and controlling their visibility via responsive settings. This method ensures the desired layout for desktop and mobile devices though please note it may introduce a slight increase in page load.
Best Regards