You can only call updateHeaders after the grid view has rendered.
Code:
if (grid.getView().innerHd) {
  grid.getView().updateHeaders();
}