Material turns black after lags

Glory to the eggs of the developer, they fixed my error and on 5.6 everything works as it did in 5.4 and more than a month of work was saved.