I have a similar issue.
504 error not 500.
JA Multilingual a few month ago worked regurlarly.
I updated joomla! to 3.8.7 and virtuemart to 3.2.14 but I don't know if that is the problem.
I also updated JA Multilingual to the last version.
Can you help me?
I don't know if some timeout is changed in the server configuration.
This can be a JA Multilingual problem or I have to ask to my web server admin?
Thanks in advance.
Regards
Joomla! 3.8.7
Virtuemart 3.2.14
PHP 5.6.33
MySQLi 5.6.36-cll-lve
Web Server Apache
WebServer interfaccia PHP cgi-fcgi