Thank you for your reply. The Permalink solution doesn’t work. The issue is explained below. If I disable the BuddyPress plugin, no 404 error.
Step 1. Visit any BuddyPress page.
Step 2. Visit non BuddyPress page and 404 error comes up. If I refresh the same page the error goes away.
Step 3. Again visit BuddyPress page and then non BuddyPress page and again 404 page.