I would suggest adding a bigger upload waiting delay on the arduino bootloader.
There have been some cases where for example serial spamming locks the chip from being written, and the IDE cannot compile a new sketch and upload it fast enough in order to avoid problems.