Ok, so it doesn’t seem to be the SD card.
I think you need to do a full wipe and install to further diagnose this. If the issue remains after that, this would hint at hardware trouble. If the issue would be fixed after that, it would have been software, which would be the lesser evil now.
Be sure to format Data in the process … (and install your LineageOS ZIP file instead of the Fairphone OSes referred to in the guide) …
If you really want to exclude a software problem, I think it would be a good idea to format System, too … I wrote a little Addendum to the guide on how to do that in TWRP …