How to reproduce:
1. “/give @s diamond_chestplate{AttributeModifiers:[{Name:a,AttributeName:generic.armor, Amount:8,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:chest}]}”
2. “/give @s diamond_boots{AttributeModifiers:[{Name:a,AttributeName:generic.armor, Amount:4,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:feet}]}”
3. Wear them on and notice the armor bar shows 2 armor bars OR the armor bar shows 4 armor bars until the player attacks something(or something to update the player) then turns into 2 armor bars.
You need unique UUIDs. Hence the name UUID 😉