Thanks to Erwin 't Hoen I found the cause of the problem. I had defined a separate entity as a specialisation of system.filedocument. I forgot to set the entity access rules and therefore nobody was allowed to view the document.
It took me so much time that I won't make this mistake ever again. But it would be nice if the debugger gave some hints that the current user is not authorised to show data...
Are you using System.Filedocument as Generalization in another entity? Yesterday I had the same problem. After using the other entity as Filedocument the problem was gone.