The error is a response from Grbl that something went wrong, this is usually due to communications or memory problems with the Nano. T2Laser stops your machine and shows the alarm "lock" for safety, you can disable the fail safe feature and also use Simple Streaming mode to see if the problem goes away.
There are many possible causes.
Electrical interference from the motors (ground the system)
Low quality USB cable (without filters)
Computer or ports going into a sleep mode (disable all power saving)
CPU hungry programs running in background when system appears idle (anti-virus, backup etc)
Nano overheating and having memory glitches (use a real Atmel chip as many of the Chinese clones exhibit this issue)
Since it is random, we know it is one of these or similar and not the G-code.