Wp set post terms not work

As stated in the wp_set_post_terms Comment:

This function will only work on the native post type. For a taxonomy on a custom post type use wp_set_object_terms()

wp_set_object_terms

error code: 523