When a user tries to open a web query file that was just exported from a report, the user is being logged out of NetSuite. This happens even if the required permission for web query is already added to the custom role.
It is possible that the user's role is not included on the Audience and Access tabs. Here are the steps to resolve the issue:
1. Open the custom report.
2. Click on the Customize button.
3. Navigate to the More Options link.
4. Under the Access and Audience tabs, select the custom role.
5. Save and Preview the report and then export the web query file.