What could be the problem? Software, hardware?
Those are the usual two choices. I'm voting for software, though.
Starting here:
String gCodeCmd = "G01";
String planeSel = "XY";
String cmdString;
Get rid of this crap. Use a char array, of a known size, and reject any input data that is larger than that size.
Although, given that you don't have a loop() function, never mind.