had something similiar recently when my delta just started randomly making spaghetti at the side of the build plate.

cleared and reformatted the sd card and that did the trick.

I think you're on the right track - might be worth getting a new sd card reader/writer for your computer.

What printer are you using ?
could be the card reader on the printer itself.

But I'd definitely lean towards a corrupted g-code file.