CANBUS MESSAGES FROM Visual Studio DONT ALWAYS INITIATE (NOOB CODER)

Hello all....to start i am very new to coding. Im trying to learn how to send commands from a Visual Studio program i am writing, to the serial port of an arduino nano, to turn on and off relays inside of a vehicle controller i am building. The issue i seem to be running into, is that the commands send and receive on the nano, but the commands only seem to be receiving randomly when i pass them over the serial port. I can receive and send the commands, and they send and receive properly over the CAN modules and to the serial monitor, but sometimes i press the send command once and it sends fine, and sometimes i have to press the command multiple times to receive the command. The two char lines are what the Visual studio code is sending to the serial port to send the CAN BUS command line.

I am using two nanos, along with MCP2515 canbus modules to pass the data back and forth. The problem i assume lies in my code i have implemented. Here is my code, its been pieced together from multiple codes, so things may be wrong with the code itself.

Can anyone please help lead me in the right direction of whats going wrong with the code?
any help appreciated, thanks.

#include <mcp_can.h>
#include <SPI.h>

MCP_CAN CAN0(10);   

 char twoStepButtonOn = ("0");
 char twoStepButtonOff = ("1");

byte twoStepOn[8] = {0x00, 0x01, 0x02, 0x0AA, 0x04, 0x05, 0x06, 0x07};
byte twoStepOff[8] = {0x00, 0x01, 0x02, 0x0FF, 0x04, 0x05, 0x06, 0x07};

void setup()
{
  SPI.begin();
  Serial.begin(500000);

  
  if (CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK) Serial.println("MCP2515 Initialized Successfully!");
  else Serial.println("Error Initializing MCP2515...");

  CAN0.setMode(MCP_NORMAL);   // Change to normal mode to allow messages to be transmitted
}

 

void twoStepOnCircuit(void){
 
 byte sndStat = CAN0.sendMsgBuf(0x001, 0, 8, twoStepOn);
  
  if (sndStat == CAN_OK) {
    
    Serial.println("Message Sent Successfully!");
  } else {
    Serial.println("Error Sending Message...");
  }
 
}
void twoStepOffCircuit(void){
  
 byte sndStat = CAN0.sendMsgBuf(0x001, 0, 8, twoStepOff);
  
  if (sndStat == CAN_OK) {
    
    Serial.println("Message Sent Successfully!");
  } else {
    Serial.println("Error Sending Message...");
  }

}

void loop()
{
  twoStepButtonOn = Serial.read();{
  if (twoStepButtonOn == '0'){
  twoStepOnCircuit();
  }
  
 
  
twoStepButtonOff = Serial.read();{
  if (twoStepButtonOff == '1'){
  twoStepOffCircuit();
  
}
}
  }
}