Hex array not working but non array works

Does anyone know why this works

void setup()
{
  Serial.begin(9600);

  delay(1000);

  Serial.write(0x03);
  delay(2);
  Serial.write(0x07);
  delay(2);
  Serial.write(0xD0);
  delay(100);
  Serial.write(0x07);
  delay(2);
  Serial.write(0x00);
  delay(2);
  Serial.write(0x64);
  delay(100);
  Serial.write(0x0F);
  delay(2);
  Serial.write(0x2A);
  delay(100);
 
}

void loop()
{  
 
}

but this does not work?

byte message[] = {0x03,0x07,0xD0,0x07,0x00,0x64,0x0F,0x2A};

 
void setup()
{
 Serial.begin(9600); 
 delay(1000);

 for (int i=0; i<7; i++)
  {
   Serial.write(message[i]);
   delay(2);
  }   
}

void loop()
{
 
}

I'm not having any luck here.

For what definition of work?

The two codes are not the same. While the values are, the intervals between the writes are not.

What are you sending that data to? Does the interval matter? Apparently it does.

On top of what Paul noticed, you are not sending the full array with your for loop - you have 8 bytes and only sending 7

You should use sizeof() to not make such errors and have adjustable code. (And your array should probably be defined as const since it does not seem to change)