Hi Xavier,
You should check the EXECUTE permissions associated with your 'RetrieveNonblockingInstanceStateIds', object in your database. The user you are running that object as should have EXECUTE permissions or it should be a member of a group with EXECUTE permissions. I hope this helps.
Please address this kind of issues on a SQL related forum for more details.
Thanks,
-Constantin