Property already exists. Use SetTexture instead - error doesn't make sense

I’m updating a 5.4.3 unity project to 5.5.1 and I get this error in a very strange context and don’t know how to fix it. (this error did not occur in 5.4.3)
The line it gets reported on is:

materialType.Material.SetTexture(id, texture);

The error seems to occur only when my id is 5, but not every time the id is 5 I get an error (don’t know if this is helpful). I would really like some help on this issue, since the error doesn’t mean anything to me, it’s telling me to use SetTexture on a row where I’m already using SetTexture. Please let me know what the actual problem is here.

I eventually found the issue, if anyone is interested:

The error was completely misleading (maybe some uncaught exception), but what was really happening was that the id I used in my call was invalid: I had 4 properties and was calling SetTexture with id 5.

Long story short: wrong error message, invalid ID.