str_replace remove words from title

the_title() will directly output the title – for your purpose in a string manipulation, you need to use get_the_title() https://developer.wordpress.org/reference/functions/get_the_title/

you also have some php syntax error;

try to use:

<?php
echo str_replace( "(Blu-ray)","&nbsp;", get_the_title() );
?>