Nokia 5110 clear screen.

I don't know how this display works, but from my quick glance at you code, I recon you could try this:

void LCDClear(void) {
  gotoXY(0, 0); //return to the home position
  for (int index = 0 ; index < (LCD_X * LCD_Y / 8) ; index++)
    LcdWrite(LCD_D, 0x00);
    
  gotoXY(0, 0); //After we clear the display, return to the home position
}