Not sure if this is relevant to such an old question, but my searching for an explanation to a related issue brought me to this confirmed bug in xarray:
https://github.com/pydata/xarray/issues/7722
This currently open issue seems to explain the type error message above for my own use-case.