something similar had happened to when it came to the head movement on startup although not exactly as yours but with the same ending result of it bannging the gantry and grinding.
For me on 1 occasion it was because in lightburn I had changed the settings in the “Laser” tab from absolute coords to on of the other settings (current position/user origin) i changed it back to absolute chords unplugged the USB cable and closed lightburn software. After I manually moved the laser head to the home position then I restarted lightburn and plugged back in the USB all was fine.
The 2nd time when my K40 started to act like me after certain interactions with my family and it began banging its laser head into the gantry.
I powered down the k40, disconnected the USB exited the software and unplugged the c3d power brick.
I then reconnected everything in the order as described in the first setup instructions of the c3d board. I think the order was k40 off, usb gets plugged into computer. Then C3d power brick get connectted. Next lightburn software is open up.
- I may be wrong in the order best to double check the 1st time setup instructions post.*
After that the k40 was back to normal and well behaved much like myself after taking my anxiety medication
Best I can determine is that it had something to do with windows 10 and the order of usb connections to interact with certain softwares. But then again I’m no expert nor have I ever been able to replicate the problem.
Hopefully this might help you