You are probably calling it too early and the context for the current post is not filled yet. get_author_posts_url()
accepts author’s ID as first argument, You probably need to retrieve and pass that to it, similar to how you retrieve the info for following call.