WP_Query() not working as expected

Ah, nevermind. Found it.

I’m using another plugin (EDD Hide Download) which hides certain downloads and does that by hooking into the pre_get_posts action, which is triggered in WP_Query. The download in question was marked as hidden, that’s why WP_Query didn’t return it.

To resolve this, I did the following.

I added an action which was triggered after EDD Hide Downloads:

add_action('plugins_loaded', [$this, 'unhide_downloads'], 11); // EDD Hide Downloads triggers at the default priority 10.

And removed the action hook responsible for inserting the wp_posts.ID NOT IN query:

public function unhide_downloads()
{
    if (function_exists('edd_hide_download')) {
        remove_action('pre_get_posts', [edd_hide_download(), 'pre_get_posts'], 9999);
    }
}