Do you have IWA enabled? If you log into a machine, and then attempt to log into O365 as a different user than the user you logged into the machine as, the browser will automatically attempt to authenticate the user with the logged on credentials. If the logged on user doesn't have access to the O365 app in question, that error will throw.
Also, that error will throw if the user you're attempting to log in with isn't in the role that O365 app is deployed to.
There are a lot of separate reasons why this could happen.
I'd like to request some more information from you, to help troubleshoot this issue. However, some of it may be considered sensitive. If you'd like, please feel free to shoot me a PM and we can troubleshoot this further.