Problem: The client was experiencing a 504 error on their multilingual e-commerce site when accessing a product page in English, despite the page working fine in other languages. The permalink settings were set to 'post name' for general links and 'custom' with a '/product/' base for product links. Solution: Upon further investigation, we discovered that the issue was also related to an outdated theme. The client was using the Deli theme, a child theme of the Storefront theme, which was not updated. After updating the Storefront theme, the 504 error was resolved.
If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.