You can’t put invalid elements inside the <head> element. When Googlebot finds any invalid elements that not supposed to be there, it thinks the <head> ends there and anything beyond that is part of the <body> element, that causes rendering issue.
HTML <head> Element: Don’t Break It