Piglins usually defend the chests in their bastions. But when a player places a chest/barrel, and opens it, the Piglins will be aggressive towards the player. even outside the Bastions.
a possible solution would be having a tag for the bastion chests or ignoring the provocation outside the bastion.
Duplicate of MC-174836 which is Works as Intended