Inserting a functions output after the content

Your shares_content function directly outputs content, which won’t work if you’re trying to assign the results to a variable or use it in a return statement within another function.

You can change it to return the string:

function shares_content() {
    $content = "<div class="social-shares-container"><a href="https://www.facebook.com/sharer/sharer.php?u=%s">Share on Facebook</a></div>";
    return sprintf( $content, get_permalink() );
}

It’s also worth pointing out here the use of get_permalink(). If you look at the source code, that function also returns its value. There is another API function, the_permalink(), which contains an echo instead of a return. That would also break your filter output. Most WordPress functions have two versions like this.