custom post type category count shortcode

I think you would be better off using get_posts or a new WP_Query instead of get_term_by. That would allow you to get posts for your custom post type, and then filter by taxonomy/term name.

If you’re comfortable enough with WP Query you could try something like this: Query posts by taxonomy term name