I can confirm it happened because of old WP version.
Got the same bug on one of the sites by mistake.
Either use compatible Yoast version (check your WP core version and download older Yoast version) or upgrade WP.
I bumped into this when was making W3C configuration on shared hosting. My advise is to save this header, but use checkbox beneath – my preference is “Same Origin”