Your use of quotes in the
sed expression is incorrect. Remove the inner double quotes and replace the outer single quotes with double quotes.
Expansion of variables does not happen inside single quotes, the method you have used works because the variables are not quoted at all now.