So far I am almost done with going through the files I need to edit, and the error did not come up again, but I made sure to delete the materials before editing. I think it really had something to do with that. If not then it is just weird. Because that helped for sure.
If you manage to get this error in a file you van share with me, then send me in PM and I try to find the problem.
Anyway, it seems to be some kind of "corruption" in this file.
I think it might have to do with materials getting reassigned weirdly when you delete/merge things. And that could lead to corruption.
Which would explain why deleting the materials helped.