There's currently no information given to developers when HSTS state fails to be set due to certificate errors (e.g. a self-signed certificate is being used). This is somewhat unhelpful so we should fix that.
BTW, there is already wrong error message is console in case of invalid SSL certificate AND Strict-Transport-Security header specification. Consider comparing https://bib.hda.org.ru/bib (valid ssl cert) https://bib-test.hda.org.ru/bib (invalid ssl cert resulting in "The site specified an invalid Strict-Transport-Security header" error message). This is not HSTS Header error, it should be described in another way.