Hi Olga,
I got reply from WPML as below:
Can you please check https://wpml.org/errata/unable-to-get-site-language-on-the-front-end-ajax-calls-when-user-is-not-logged-in/ ?
I followed the post to change the php file, it works. Please note.