Custom WP_Query not returning results when querying custom post type

I’ve found the solution. The problem was I had a different number set for the posts_per_page parameter in the initial query and in the custom query I make via AJAX. In the code I provided posts_per_page is not even there because I’m using a few nested classes, so I’ve posted a stripped-down version of the code for simplicity. I was sure the issues was with custom post types, never thought using different posts_per_page could cause a problem. Apologies about that.

So yeah, if you’re running into the same problem make sure that your posts_per_page is the same for all your queries!