The health check must be removed via configuration, through the appsettings.json file, environment variables, or similar.
The HstsCheck key is E2048C48-21C5-4BE1-A80B-8062162DF124 so the appsettings will look something like:
"Umbraco": {
"CMS": {
"HealthChecks" : {
"DisabledChecks": [
{
"Id": "E2048C48-21C5-4BE1-A80B-8062162DF124"
}
]
},
{...}