get_term_link() returns correct – But illogical error-messages disturb

get_term_link() will return a WP_Error object on error.

You can’t print an object or array or you will get messages similar to what you are getting. Use var_dump() instead or print_r() and you should see what is occuring. Your error even tells you that WP_Error is the object involved.

You are getting errors when the term you are looking for is not found.

And yes, you should hide your error messages on a production site. They can be revealing. Write to a log if you must have errors on the production site.

error code: 523