relation "table" does not exist
The error message is unrelated to privileges. The table valeur simply cannot be found. There must be some kind of confusion. My educated guess:

You call the function without schema qualification and accidentally execute a different function of the same name, because pckg_50d_facture is not in the search_path (or is there but in a later position). See:


How does the search_path influence identifier resolution and the “current schema”


Or you connected to the wrong database / database cluster by mistake.