It could be a lack of permissions, are you fetching nodes from public sections?, or sections where your user has read permissions ?
I think that EZP 3.4.x setup gives annonymous read permission for Standard Section by default, so you may need to give annonymous read access permission for your custom sections