The reason I think it is a PATH issue is that behavior has been seen before. There can, apparently, be different versions of ls and if the order is wrong the error message will not be the one the tester expects: Cd ~ test is flaky - #13 by hypatia-of-sva . Despite the confusion in terms of output, it is a good test.
Of course it might be something else, but in above case you can see how the wrong path gives the cannot access fragment of the error message.