I had a similar issue. Running this code worked for me. Essentially it gets the actual skeletal mesh materials and resets them to themselves before applying new materials to specific slots.