Error -1 while reading from i2c

Hello, I made a sample code for testing i2c functions, but I get apo status -1.

The code is:

NvU32 size = 48;
  NvU8 data[48] = {0};

  NV_I2C_INFO i2c_info = {
      NV_I2C_INFO_VER,
      0,
      NV_TRUE,
      0x50,
      nullptr,
      0,
      data,
      size,
      NVAPI_I2C_SPEED_DEFAULT,
  };

  nvapiStatus = NvAPI_I2CRead(hGPU_a[1], &i2c_info);

  if (nvapiStatus!=NVAPI_OK)
    printf("Error running I2CRead() with code: %d", nvapiStatus);
  else {
    for (auto i = 0; i < sizeof(data); i++) {
      printf("%4d", data[i]);
    }
  }