ATTiny85 with 74HC595 not matching ?

The error on line 131 of your sketch explains the behavior you described.