Most likely plugin related in your case: BuddyPress seems to set the global post ID to 0 on its virtual pages, (see e.g. this ticket).
Most likely plugin related in your case: BuddyPress seems to set the global post ID to 0 on its virtual pages, (see e.g. this ticket).