Finally found the culprit. It is a silly mistake which I overlooked. I added a custom post type and modified the query in functions.php to include the new custom post type in archives, but I hard-coded the post types rather than using get_post_types() to include all post types available (including those added by plugins).
The problem is already solved now. Thanks for helping.