“Login as Customer” doesn’t work as intended if customer has large amount of items in cart

Tested on some accounts, it goes to frontend successfully, gives a success message, redirects to the customer account index and shows a sticky header with session ending button.

The faulty account in this case loads to frontend and gives Fail to get authentication data. message that is seemingly from vendor/magento/module-login-as-customer/Model/GetAuthenticationDataBySecret.php.
Still logs in since I see populated cart, but no login logs are saved in admin and previously mentioned elements are not rendering.

For context, the customer is Chinese; others from the same country don’t cause any issues.

Why is it happening?

Upd. Customers with large carts, 400+ items, are triggering this behaviour.