Not entirely sure if it is a bug, or a feature.
But opening shulker boxes, or ender chests near piglins causes them to attack the player.
If this is a intended feature, I propose that maybe allow the player to open ender chests and shulker boxes near the piglins since it is not considered to be the piglin's loot
Duplicates of MC-174836 and MC-172239. It's a feature.