I totally missed that. I was doing some permissions for a feature (the role setting) and I completely forgot to check if the user was logged in! (So, I was requesting the role of a non-logged in user.)
I missed it because I was logged in and did not try it while logged out.
This was affecting the whole site somehow, its fixed now though!