Exposing WordPress Custom Post Types to REST: Pagination, Headers, and the Cost of Deep Pages
A custom post type can be queryable in WP_Query and still invisible to REST clients. Enable show_in_rest, then paginate with built-in collection parameters and read X-WP-Total headers instead of counting pages yourself.