Some maps have accessory chests you can buy multiple same accessories from. The item will be put by the system into the next free accessory slot. The amount is limited internally (e. g. you can buy only 3 worm scarfs (on a map of which I don’t remember the name), if you could buy 6 worm scarfs for all the accessory slots you’d have a damage reduction of 1.00-(0.83)^6 = 67.3% damage reduction which would be unbalanced due to getting from a 100 dmg hit only 33).
It says Failed to buy Ankh Shield. Your accessory slots are full. in the first screenshot; maybe it has something to do with filling slots with non-existent items? I’m not sure if the number of accessories allowed variable is updated to your actual inventory number of accessories, although it probably would be…