str_replace with the_content is not working

If you give a look at the documentation, of str_replace you will find your needs. https://www.php.net/manual/en/function.str-replace.php

There is 3 choices for you there :

function replace_text_wps($text){
    $replace = array(
        'https://www.facebook.com/something">' => 'https://www.instagram.com/something">',
    );
    $text = str_replace(array_keys($replace), array_values($replace), $text);

    // OR
    $text = str_replace(array(
        'https://www.facebook.com/something">'
    ), array(
        'https://www.instagram.com/something">'
    ), $text);
    
    // OR 
    $text = str_replace('https://www.facebook.com/something">', 'https://www.instagram.com/something">', $text);
        
    return $text;
}
 
add_filter('the_content', 'replace_text_wps',99, 1);