The WP_Query/ WP was referring to the “class-wp-query.php”/ “class-wp.php” files in the WP default package. No changes have been made to both files.
I have tried the permalinks suggested but it still does not work.
The issue should not be due to plugins as there are no plugins used in the page itself.
Note: The issue had only arisen after the WP upgrade to 5.7.8. Prior to this, the site was using WP 5.4 and the issue does not exist.