some of our users have problems open an Office file in SharePoint. The have the right permissions, so they can delete or rename it. After renaming the file open in Office client is no problem. Named it back and the error message ( You cannot open the file please check the permission ) by opening in the Office client comes again.
The error shows up after the Office client was loaded and open directly in in the client (so it comes not from SharePoint).
From time to time I have issues when opening and save files in SPO, and specifically when doing from Teams...but in general, it works well. Not sure how we can help you with this issue since this is out of the box functionality and there is not a setting in SPO / Office to detect the issue happening and how to fix it.