I had a similar issue because my ElasticClient had no
.EnableApiVersioningHeader()
Specified in its settings.
After this line was added, the error disappeared.