Display in category ( taxonomy) a number of post that I want

If I understand your question right you seem to have the code that seems close to what you want, but doesn’t function correctly. What I have trouble following is that your description talks about taxonomy archives, but your code seems to be about custom post type archives.

I would suggest to use more appropriate query methods rather than working with vars directly:

  • $query->is_tax() to check for taxonomy archives
  • $query->is_post_type_archive() to check for CPT archives
  • $query->set() to modify query vars