Re: bp_displayed_user_username or another?
I think this “bp_core_get_username” is used only for one member. This doesn’t work on members-loop.php where it should list member names and avatars on the Members Directory.
The function should be something equivalent to
<?php bp_member_name() ?>
But instead of member nickname it should return login ids of members.
I just found the following custom function, but I wonder why this function is not built in by default.
https://buddypress.org/forums/topic/display-username-in-members-directory#post-41928