It sounds like the issue might be caused by a conflict with one of your plugins, particularly those related to links, SEO, or optimization. I recommend disabling these plugins one by one to see if any of them are causing the 404 error. Additionally, some WordPress themes have built-in SEO or link-related tools, so it’s worth checking if your theme has any similar features that could be interfering.
To troubleshoot, try temporarily switching to a default WordPress theme (like Twenty Twenty-Three) and see if the gallery works without the error. This will help you pinpoint whether it’s a plugin or theme causing the issue.
If you’re still having trouble after these steps, feel free to reach out, and we’ll be happy to assist further!