There are 2 problems with your code to achieve what you want:
The if condition it’s wrong, it’ll always return true, because you’re using “,” to join conditions and this will return the last element (which is a string and will be taken as “true”). To read more about the comma operator read [1]. Instead you have to join your conditions with a “||” operator. Another way would be using an array (if it’s easier for you), this would be the condition:
['#F7B16B', '#B6D7A8', '#C9DBF8'].includes(bgColors[i][j])
You’re using the clearContent() function to clear the contents, but you also need to use the clearFormat() function if you wish to clear the format. [2]
function myFunction() {
var sheet = SpreadsheetApp.getActive().getSheetByName('HSRD');
var range = sheet.getRange("HSRD!B5:B8");
var bgColors = range.getBackgrounds();
for (var i=0; i<bgColors.length; i++) {
for (var j=0; j<bgColors[i].length; j++) {
if (bgColors[i][j] === '#F7B16B' || bgColors[i][j] === '#B6D7A8 || bgColors[i][j] === '#C9DBF8) {
range.getCell(i+1,j+1).clearContent().clearFormat();
}
}
}
}
Also, be sure you’re using the right color codes, you can check this using Logger.log(bgColors) to see in the App script log (View->Logs) all the color codes you have in that range.
[1] https://javascriptweblog.wordpress.com/2011/04/04/the-javascript-comma-operator/
[2] https://developers.google.com/apps-script/reference/spreadsheet/range#clearFormat()