Perhaps you’re modifying a cloned Material value?
Materials materials array of materials renderer:
Generally accessing .material / .materials is going to give you a fresh copy. (See docs for why and when)