I have experienced a similar issue, which turned out to be a permissions issue with the hosting provider. I would look into this first as this was the issue I found with editing theme files.
1. Possible wp-content permissions issue or on a large scale htdocs permission folder issue.
The other possible issue is the addition of a htaccess file, in a folder it shouldn’t be. I would review the folders and directories and delete where applicable. This issue has occurred a few times for me in the last 12 months.
Thanks Prabhukb _ I have just used the code to solve a problem I have had with the same issue.