When a payload that includes the userName property is POSTed to /query.json Drill will check for authorisation and, if that's found, replace the username on its UserSession with that of the impersonated user. When a subsequent request arrives Drill will again attempt the same replacement, but now starting from a UserSession user that has already been changed to the impersonated user. This is liable to fail when the impersonated user is not authorised to impersonate themself.
This has never been an issue in the Web UI because it only presents an opportunity for impersonation when impersonation is enabled and authn is disabled. When authn is disabled, there is no persistent UserSession so it is okay to repeat the username replacement for every request to /query.json. This leaves people who have both impersonation and authn enabled in the lurch.